Skip to content

Commit

Permalink
drbd: Do not sleep inside rcu
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Andreas Gruenbacher authored and Jens Axboe committed Jun 28, 2013
1 parent f35546e commit 26ea8f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,8 @@ static int conn_connect(struct drbd_tconn *tconn)
rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
kref_get(&mdev->kref);
rcu_read_unlock();

/* Prevent a race between resync-handshake and
* being promoted to Primary.
*
Expand All @@ -1049,8 +1051,6 @@ static int conn_connect(struct drbd_tconn *tconn)
mutex_lock(mdev->state_mutex);
mutex_unlock(mdev->state_mutex);

rcu_read_unlock();

if (discard_my_data)
set_bit(DISCARD_MY_DATA, &mdev->flags);
else
Expand Down

0 comments on commit 26ea8f9

Please sign in to comment.