Commit d0c3f60f authored by Philipp Reisner's avatar Philipp Reisner

drbd: Make sure we do not send state updates during an empty resync [Bugz 271]

This is a race condition that existed for ages.
The previous commit reduces the window, this one closes it.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 309d1608
...@@ -1380,7 +1380,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) ...@@ -1380,7 +1380,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
_drbd_pause_after(mdev); _drbd_pause_after(mdev);
} }
write_unlock_irq(&global_state_lock); write_unlock_irq(&global_state_lock);
drbd_state_unlock(mdev);
put_ldev(mdev); put_ldev(mdev);
if (r == SS_SUCCESS) { if (r == SS_SUCCESS) {
...@@ -1393,7 +1392,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) ...@@ -1393,7 +1392,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
/* Peer still reachable? Beware of failing before-resync-target handlers! */ /* Peer still reachable? Beware of failing before-resync-target handlers! */
ping_peer(mdev); ping_peer(mdev);
drbd_resync_finished(mdev); drbd_resync_finished(mdev);
return;
} }
/* ns.conn may already be != mdev->state.conn, /* ns.conn may already be != mdev->state.conn,
...@@ -1405,6 +1403,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) ...@@ -1405,6 +1403,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
drbd_md_sync(mdev); drbd_md_sync(mdev);
} }
drbd_state_unlock(mdev);
} }
int drbd_worker(struct drbd_thread *thi) int drbd_worker(struct drbd_thread *thi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment