From 01a337b35d97b7afc66f3c37744f188f6c0ae885 Mon Sep 17 00:00:00 2001 From: Joel Colledge Date: Thu, 23 Mar 2023 11:36:03 +0100 Subject: [PATCH] drbd: do not allow transition from paused sync to bitmap exchange As described in the recent commit "drbd: use mod_timer() instead of add_timer() for starting resync", we may receive UUIDs from the peer while we are in PausedSyncS state. We do not want to switch to WFBitMapS in this case. The peer may still be in WFBitMapT state and does not expect to receive the bitmap again. --- drbd/drbd_state.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c index aba89fc17..4803d081a 100644 --- a/drbd/drbd_state.c +++ b/drbd/drbd_state.c @@ -1757,10 +1757,12 @@ static enum drbd_state_rv __is_valid_soft_transition(struct drbd_resource *resou peer_device->connection->agreed_pro_version < 88) return SS_NOT_SUPPORTED; - if (repl_state[OLD] == L_SYNC_SOURCE && repl_state[NEW] == L_WF_BITMAP_S) + if (repl_is_sync_source(repl_state[OLD]) && + repl_state[NEW] == L_WF_BITMAP_S) return SS_RESYNC_RUNNING; - if (repl_state[OLD] == L_SYNC_TARGET && repl_state[NEW] == L_WF_BITMAP_T) + if (repl_is_sync_target(repl_state[OLD]) && + repl_state[NEW] == L_WF_BITMAP_T) return SS_RESYNC_RUNNING; if (repl_state[NEW] != repl_state[OLD] &&