Signed-off-by: Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx> --- drivers/block/rbd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 70ca81d..a13bb06 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3025,7 +3025,9 @@ static void rbd_acquire_lock(struct work_struct *work) * want to block. */ if (!(rbd_dev->disk->flags & GENHD_FL_UP)) { + down_write(&rbd_dev->lock_rwsem); set_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags); + up_write(&rbd_dev->lock_rwsem); /* wake "rbd map --exclusive" process */ wake_requests(rbd_dev, false); } @@ -3471,7 +3473,9 @@ static void rbd_reregister_watch(struct work_struct *work) if (ret) { rbd_warn(rbd_dev, "failed to reregister watch: %d", ret); if (ret == -EBLACKLISTED || ret == -ENOENT) { + down_write(&rbd_dev->lock_rwsem); set_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags); + up_write(&rbd_dev->lock_rwsem); wake_requests(rbd_dev, true); } else { queue_delayed_work(rbd_dev->task_wq, -- 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