summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2013-06-25 16:50:03 +0200
committerJens Axboe <axboe@kernel.dk>2013-06-28 16:04:36 +0200
commit26ea8f9239a062a47cfef38ea9c63409906366ff (patch)
tree959c1873eb49d82e45a4402202544a3179487ac6 /drivers/block
parentf35546e072a7a86ccb950d4d1508879b0d49e374 (diff)
downloadlwn-26ea8f9239a062a47cfef38ea9c63409906366ff.tar.gz
lwn-26ea8f9239a062a47cfef38ea9c63409906366ff.zip
drbd: Do not sleep inside rcu
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_receiver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 4222affff488..adee58e19e83 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1039,6 +1039,8 @@ randomize:
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.
*
@@ -1049,8 +1051,6 @@ randomize:
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