From: Andreas Gruenbacher Date: Tue, 25 Jun 2013 14:50:03 +0000 (+0200) Subject: drbd: Do not sleep inside rcu X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=26ea8f9239a062a47cfef38ea9c63409906366ff;p=openwrt%2Fstaging%2Fblogic.git drbd: Do not sleep inside rcu Signed-off-by: Andreas Gruenbacher Signed-off-by: Jens Axboe --- 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