mirror-linux/drivers/block
Ilya Dryomov ec062367fa rbd: prevent busy loop when requesting exclusive lock
commit 9d01e07fd1 upstream.

Due to rbd_try_acquire_lock() effectively swallowing all but
EBLOCKLISTED error from rbd_try_lock() ("request lock anyway") and
rbd_request_lock() returning ETIMEDOUT error not only for an actual
notify timeout but also when the lock owner doesn't respond, a busy
loop inside of rbd_acquire_lock() between rbd_try_acquire_lock() and
rbd_request_lock() is possible.

Requesting the lock on EBUSY error (returned by get_lock_owner_info()
if an incompatible lock or invalid lock owner is detected) makes very
little sense.  The same goes for ETIMEDOUT error (might pop up pretty
much anywhere if osd_request_timeout option is set) and many others.

Just fail I/O requests on rbd_dev->acquiring_list immediately on any
error from rbd_try_lock().

Cc: stable@vger.kernel.org # 588159009d5b: rbd: retrieve and check lock owner twice before blocklisting
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 12:08:21 +02:00
..
aoe
drbd drbd: correctly submit flush bio on barrier 2023-05-11 23:03:39 +09:00
mtip32xx
null_blk null_blk: Fix: memory release when memory_backed=1 2023-06-28 11:12:39 +02:00
paride
rnbd block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE 2023-06-09 10:34:09 +02:00
xen-blkback
zram
Kconfig
Makefile
amiflop.c
ataflop.c
brd.c brd: use radix_tree_maybe_preload instead of radix_tree_preload 2023-03-10 09:34:34 +01:00
floppy.c
loop.c loop: LOOP_CONFIGURE: send uevents for partitions 2023-04-06 12:10:47 +02:00
n64cart.c
nbd.c nbd: Fix debugfs_create_dir error checking 2023-06-09 10:34:09 +02:00
pktcdvd.c pktcdvd: check for NULL returna fter calling bio_split_to_limits() 2023-01-24 07:24:37 +01:00
ps3disk.c
ps3vram.c block: handle bio_split_to_limits() NULL return 2023-01-18 11:58:33 +01:00
rbd.c rbd: prevent busy loop when requesting exclusive lock 2023-08-11 12:08:21 +02:00
rbd_types.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:33:47 +01:00
swim.c
swim3.c
swim_asm.S
ublk_drv.c ublk: fail to recover device if queue setup is interrupted 2023-08-03 10:24:07 +02:00
virtio_blk.c virtio_blk: Fix signedness bug in virtblk_prep_rq() 2023-01-12 12:02:54 +01:00
xen-blkfront.c xen/blkfront: Only check REQ_FUA for writes 2023-06-21 16:00:53 +02:00
z2ram.c