Commit f5e2b8b3 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

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: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent ae25b336
...@@ -1744,12 +1744,13 @@ int drbd_worker(struct drbd_thread *thi) ...@@ -1744,12 +1744,13 @@ int drbd_worker(struct drbd_thread *thi)
*/ */
spin_unlock_irq(&tconn->data.work.q_lock); spin_unlock_irq(&tconn->data.work.q_lock);
/* _drbd_set_state only uses stop_nowait.
* wait here for the exiting receiver. */
drbd_thread_stop(&tconn->receiver); drbd_thread_stop(&tconn->receiver);
down_read(&drbd_cfg_rwsem); down_read(&drbd_cfg_rwsem);
idr_for_each_entry(&tconn->volumes, mdev, vnr) { idr_for_each_entry(&tconn->volumes, mdev, vnr) {
D_ASSERT(mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE); D_ASSERT(mdev->state.disk == D_DISKLESS && mdev->state.conn == C_STANDALONE);
/* _drbd_set_state only uses stop_nowait.
* wait here for the exiting receiver. */
drbd_mdev_cleanup(mdev); drbd_mdev_cleanup(mdev);
} }
up_read(&drbd_cfg_rwsem); up_read(&drbd_cfg_rwsem);
......
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