aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-03-02 09:06:45 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-03-11 10:10:40 -0500
commitd0c3f60f3611ceac9b1e4fdffd1497337568e7cb (patch)
treeeb351f4e76a99dfed3545c52f1facf65e605be79 /drivers
parent309d1608cce32903d67d47e7545e232c400b6aa0 (diff)
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: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/drbd/drbd_worker.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 4672f2f37b51..44bf6d11197e 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1380,7 +1380,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
1380 _drbd_pause_after(mdev); 1380 _drbd_pause_after(mdev);
1381 } 1381 }
1382 write_unlock_irq(&global_state_lock); 1382 write_unlock_irq(&global_state_lock);
1383 drbd_state_unlock(mdev);
1384 put_ldev(mdev); 1383 put_ldev(mdev);
1385 1384
1386 if (r == SS_SUCCESS) { 1385 if (r == SS_SUCCESS) {
@@ -1393,7 +1392,6 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
1393 /* Peer still reachable? Beware of failing before-resync-target handlers! */ 1392 /* Peer still reachable? Beware of failing before-resync-target handlers! */
1394 ping_peer(mdev); 1393 ping_peer(mdev);
1395 drbd_resync_finished(mdev); 1394 drbd_resync_finished(mdev);
1396 return;
1397 } 1395 }
1398 1396
1399 /* ns.conn may already be != mdev->state.conn, 1397 /* 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 1403
1406 drbd_md_sync(mdev); 1404 drbd_md_sync(mdev);
1407 } 1405 }
1406 drbd_state_unlock(mdev);
1408} 1407}
1409 1408
1410int drbd_worker(struct drbd_thread *thi) 1409int drbd_worker(struct drbd_thread *thi)