diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-04-24 14:52:20 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:49:05 -0500 |
commit | f5e2b8b3b6bed8c60103b4ed5341af072129d7c0 (patch) | |
tree | 11dde69cbbead3461ba2d8588a72a1def929b7e3 | |
parent | ae25b336e0e00eafd61f1cc1c3e9e1c0d2b8fc51 (diff) |
drbd: move comment about stopping the receiver thread to where it belongs
When the last volume of a replication group is unconfigured,
the worker thread exits. To not interfere with cleanup
of other threads, before the the last cleanups run,
we need to make sure the receiver has already exited.
The commend explaining that clearly belongs above
drbd_thread_stop(&tconn->receiver), not in the cleanup loop below.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 2c43cf0918c4..9d1ba8ea6818 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1744,12 +1744,13 @@ int drbd_worker(struct drbd_thread *thi) | |||
1744 | */ | 1744 | */ |
1745 | spin_unlock_irq(&tconn->data.work.q_lock); | 1745 | spin_unlock_irq(&tconn->data.work.q_lock); |
1746 | 1746 | ||
1747 | /* _drbd_set_state only uses stop_nowait. | ||
1748 | * wait here for the exiting receiver. */ | ||
1747 | drbd_thread_stop(&tconn->receiver); | 1749 | drbd_thread_stop(&tconn->receiver); |
1750 | |||
1748 | down_read(&drbd_cfg_rwsem); | 1751 | down_read(&drbd_cfg_rwsem); |
1749 | idr_for_each_entry(&tconn->volumes, mdev, vnr) { | 1752 | idr_for_each_entry(&tconn->volumes, mdev, vnr) { |
1750 | D_ASSERT(mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE); | 1753 | D_ASSERT(mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE); |
1751 | /* _drbd_set_state only uses stop_nowait. | ||
1752 | * wait here for the exiting receiver. */ | ||
1753 | drbd_mdev_cleanup(mdev); | 1754 | drbd_mdev_cleanup(mdev); |
1754 | } | 1755 | } |
1755 | up_read(&drbd_cfg_rwsem); | 1756 | up_read(&drbd_cfg_rwsem); |