When we got an -EBLACKLISTED, we need to wakeup the waiters, otherwise, they will wait forever. Signed-off-by: Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx> --- drivers/block/rbd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 57816c2..4c5f36e 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3031,14 +3031,19 @@ static void rbd_acquire_lock(struct work_struct *work) dout("%s rbd_dev %p\n", __func__, rbd_dev); again: lock_state = rbd_try_acquire_lock(rbd_dev, &ret); - if (lock_state != RBD_LOCK_STATE_UNLOCKED || ret == -EBLACKLISTED) { - if (lock_state == RBD_LOCK_STATE_LOCKED) - wake_requests(rbd_dev, true); + if (lock_state == RBD_LOCK_STATE_LOCKED) { + wake_requests(rbd_dev, true); dout("%s rbd_dev %p lock_state %d ret %d - done\n", __func__, rbd_dev, lock_state, ret); return; } + if (ret == -EBLACKLISTED) { + set_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags); + wake_requests(rbd_dev, true); + return; + } + ret = rbd_request_lock(rbd_dev); if (ret == -ETIMEDOUT) { goto again; /* treat this as a dead client */ -- 1.8.3.1