From b19dce4b05338481acf23c1166dac64e0ad3dd28 Mon Sep 17 00:00:00 2001 From: Philipp Reisner Date: Tue, 2 Mar 2010 15:06:45 +0100 Subject: [PATCH 12/16] Make sure we do not send state updates during an empty resync [Bugz 271] This is a race condition that existed for ages. The window of vulnerability got radically increased with commit 4b6803a3276652da3737a2403f64cfcf5314e1cb. (was between 8.3.2 and 8.3.3) Therefore bug 271 is not reproducible with 8.2.6 but with 8.3.6. The previous commit reduces the window, this one closes it. --- drbd/drbd_worker.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drbd/drbd_worker.c b/drbd/drbd_worker.c index d6deead..b305f25 100644 --- a/drbd/drbd_worker.c +++ b/drbd/drbd_worker.c @@ -1415,7 +1415,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) _drbd_pause_after(mdev); } write_unlock_irq(&global_state_lock); - drbd_state_unlock(mdev); put_ldev(mdev); if (r == SS_SUCCESS) { @@ -1428,7 +1427,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) /* Peer still reachable? Beware of failing before-resync-target handlers! */ ping_peer(mdev); drbd_resync_finished(mdev); - return; } /* ns.conn may already be != mdev->state.conn, @@ -1440,6 +1438,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) drbd_md_sync(mdev); } + drbd_state_unlock(mdev); } int drbd_worker(struct drbd_thread *thi) -- 1.6.3.3