WSL2-Linux-Kernel/drivers/block
Tasos Sahanidis ff732e9bf6 floppy: Fix hang in watchdog when disk is ejected
[ Upstream commit fb48febce7 ]

When the watchdog detects a disk change, it calls cancel_activity(),
which in turn tries to cancel the fd_timer delayed work.

In the above scenario, fd_timer_fn is set to fd_watchdog(), meaning
it is trying to cancel its own work.
This results in a hang as cancel_delayed_work_sync() is waiting for the
watchdog (itself) to return, which never happens.

This can be reproduced relatively consistently by attempting to read a
broken floppy, and ejecting it while IO is being attempted and retried.

To resolve this, this patch calls cancel_delayed_work() instead, which
cancels the work without waiting for the watchdog to return and finish.

Before this regression was introduced, the code in this section used
del_timer(), and not del_timer_sync() to delete the watchdog timer.

Link: https://lore.kernel.org/r/399e486c-6540-db27-76aa-7a271b061f76@tasossah.com
Fixes: 070ad7e793 ("floppy: convert to delayed work and single-thread wq")
Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:03:26 +01:00
..
aoe for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
drbd block: move the bdi from the request_queue to the gendisk 2021-08-09 11:53:23 -06:00
mtip32xx mtip32xx: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-30 15:34:04 -06:00
null_blk null_blk: add error handling support for add_disk() 2021-08-23 12:55:46 -06:00
paride SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
rnbd block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs 2021-10-12 10:39:57 -06:00
rsxx for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
xen-blkback isystem: trim/fixup stdarg.h and other headers 2021-08-19 09:02:55 +09:00
zram zram: off by one in read_block_state() 2021-11-18 19:17:10 +01:00
Kconfig SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
Makefile drivers/block: remove the umem driver 2021-03-24 06:57:40 -06:00
amiflop.c amiflop: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:54:43 -06:00
ataflop.c ataflop: remove ataflop_probe_lock mutex 2021-11-18 19:17:07 +01:00
brd.c brd: reduce the brd_devices_mutex scope 2021-10-17 06:51:19 -06:00
cryptoloop.c cryptoloop: add a deprecation warning 2021-08-27 10:44:54 -06:00
floppy.c floppy: Fix hang in watchdog when disk is ejected 2022-01-27 11:03:26 +01:00
loop.c loop: Use pr_warn_once() for loop_control_remove() warning 2021-12-17 10:30:15 +01:00
loop.h loop: reduce the loop_ctl_mutex scope 2021-09-03 22:14:40 -06:00
n64cart.c n64cart: fix return value check in n64cart_probe() 2021-09-09 14:24:02 -06:00
nbd.c nbd: fix possible overflow for 'first_minor' in nbd_dev_add() 2021-11-18 19:17:05 +01:00
pktcdvd.c block: move the bdi from the request_queue to the gendisk 2021-08-09 11:53:23 -06:00
ps3disk.c ps3disk: use memcpy_{from,to}_bvec 2021-08-02 13:37:27 -06:00
ps3vram.c ps3vram: use bvec_virt 2021-08-16 10:50:33 -06:00
rbd.c rbd: use bvec_virt 2021-08-16 10:50:33 -06:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
sunvdc.c Char / Misc driver updates for 5.14-rc1 2021-07-05 13:42:16 -07:00
swim.c swim: use blk_mq_alloc_disk 2021-06-11 11:53:03 -06:00
swim3.c swim3: use blk_mq_alloc_disk 2021-06-11 11:53:02 -06:00
swim_asm.S
sx8.c sx8: use the internal state machine to check if del_gendisk needs to be called 2021-08-12 10:29:36 -06:00
virtio_blk.c Revert "virtio-blk: Add validation for block size in config space" 2021-10-13 08:35:36 -04:00
xen-blkfront.c xen/blkfront: harden blkfront against event channel storms 2021-12-22 09:32:51 +01:00
z2ram.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00