Skip to content

Commit

Permalink
drbd: do not allow transition from paused sync to bitmap exchange
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JoelColledge committed Mar 24, 2023
1 parent f560511 commit 01a337b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drbd/drbd_state.c
Expand Up @@ -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] &&
Expand Down

0 comments on commit 01a337b

Please sign in to comment.