]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rbd: lock should be quiesced on reacquire
authorIlya Dryomov <idryomov@gmail.com>
Thu, 30 May 2019 09:15:23 +0000 (11:15 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Jul 2019 12:01:45 +0000 (14:01 +0200)
commita2b1da09793d003410b57f96eaf7e83e43b7a50a
tree9f9c5a9723b3bebb43b7c6460327b00f99675e9c
parent793333a303c90174c317e3fa12e898bbc02daee4
rbd: lock should be quiesced on reacquire

Quiesce exclusive lock at the top of rbd_reacquire_lock() instead
of only when ceph_cls_set_cookie() fails.  This avoids a deadlock on
rbd_dev->lock_rwsem.

If rbd_dev->lock_rwsem is needed for I/O completion, set_cookie can
hang ceph-msgr worker thread if set_cookie reply ends up behind an I/O
reply, because, like lock and unlock requests, set_cookie is sent and
waited upon with rbd_dev->lock_rwsem held for write.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
drivers/block/rbd.c