kernel_samsung_a53x/drivers/block
Ilya Dryomov 0c96499c6c rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings
commit 2237ceb71f89837ac47c5dce2aaa2c2b3a337a3c upstream.

Every time a watch is reestablished after getting lost, we need to
update the cookie which involves quiescing exclusive lock.  For this,
we transition from RBD_LOCK_STATE_LOCKED to RBD_LOCK_STATE_QUIESCING
roughly for the duration of rbd_reacquire_lock() call.  If the mapping
is exclusive and I/O happens to arrive in this time window, it's failed
with EROFS (later translated to EIO) based on the wrong assumption in
rbd_img_exclusive_lock() -- "lock got released?" check there stopped
making sense with commit a2b1da09793d ("rbd: lock should be quiesced on
reacquire").

To make it worse, any such I/O is added to the acquiring list before
EROFS is returned and this sets up for violating rbd_lock_del_request()
precondition that the request is either on the running list or not on
any list at all -- see commit ded080c86b3f ("rbd: don't move requests
to the running list on errors").  rbd_lock_del_request() ends up
processing these requests as if they were on the running list which
screws up quiescing_wait completion counter and ultimately leads to

    rbd_assert(!completion_done(&rbd_dev->quiescing_wait));

being triggered on the next watch error.

Cc: stable@vger.kernel.org # 06ef84c4e9c4: rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait
Cc: stable@vger.kernel.org
Fixes: 637cd060537d ("rbd: new exclusive lock wait/wake code")
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>
2024-11-23 23:20:16 +01:00
..
aoe aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts 2024-11-19 08:44:37 +01:00
drbd Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtip32xx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
null_blk null_blk: fix validation of block size 2024-11-19 14:19:47 +01:00
paride Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rnbd block/rnbd-srv: Check for unlikely string overflow 2024-11-18 12:13:13 +01:00
rsxx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xen-blkback Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
zram block: zram_drv: Allow creation of only one ZRAM device 2024-11-19 18:06:30 +01:00
amiflop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ataflop.c block: ataflop: more blk-mq refactoring fixes 2024-11-18 22:25:42 +01:00
brd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cryptoloop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
floppy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loop.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nbd.c nbd: null check for nla_nest_start 2024-11-19 08:44:37 +01:00
pktcdvd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ps3disk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ps3vram.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rbd.c rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings 2024-11-23 23:20:16 +01:00
rbd_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skd_main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skd_s1120.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunvdc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
swim.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
swim3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
swim_asm.S Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
umem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
umem.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virtio_blk.c virtio-blk: Ensure no requests in virtqueues before deleting vqs. 2024-11-18 22:25:34 +01:00
xen-blkfront.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xsysace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
z2ram.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00