[PATCH 6/9] rbd: wake up waiter in rbd_acquire_lock if we got -EBLACKLISTED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx>
---
 drivers/block/rbd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a13bb06..39ca0d7 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3007,7 +3007,17 @@ static void rbd_acquire_lock(struct work_struct *work)
 again:
 	lock_state = rbd_try_acquire_lock(rbd_dev, &ret);
 	if (lock_state != RBD_LOCK_STATE_UNLOCKED || ret == -EBLACKLISTED) {
+		bool need_wakeup = false;
+
+		if (ret == -EBLACKLISTED) {
+			down_write(&rbd_dev->lock_rwsem);
+			set_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags);
+			up_write(&rbd_dev->lock_rwsem);
+			need_wakeup = true;
+		}
 		if (lock_state == RBD_LOCK_STATE_LOCKED)
+			need_wakeup = true;
+		if (need_wakeup)
 			wake_requests(rbd_dev, true);
 		dout("%s rbd_dev %p lock_state %d ret %d - done\n", __func__,
 		     rbd_dev, lock_state, ret);
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux