linux/drivers/block
Tasos Sahanidis fb48febce7 floppy: Fix hang in watchdog when disk is ejected
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>
2021-12-03 06:32:40 -07:00
..
aoe block: aoe: fixup coccinelle warnings 2021-10-21 08:54:15 -06:00
drbd block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
mtip32xx block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
null_blk null_blk: allow zero poll queues 2021-12-02 19:57:47 -07:00
paride block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
rnbd block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
rsxx block/rsxx: add error handling support for add_disk() 2021-10-18 14:41:36 -06:00
xen-blkback block: remove GENHD_FL_CD 2021-11-29 06:35:21 -07:00
zram block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
amiflop.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
ataflop.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
brd.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
floppy.c floppy: Fix hang in watchdog when disk is ejected 2021-12-03 06:32:40 -07:00
Kconfig vhost,virtio,vhost: fixes,features 2021-11-03 15:00:39 -07:00
loop.c loop: don't hold lo_mutex during __loop_clr_fd() 2021-11-29 06:41:47 -07:00
loop.h block: remove support for cryptoloop and the xor transfer 2021-10-22 08:34:58 -06:00
Makefile block: remove support for cryptoloop and the xor transfer 2021-10-22 08:34:58 -06:00
n64cart.c block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART 2021-11-29 06:35:21 -07:00
nbd.c for-5.16/drivers-2021-11-09 2021-11-09 11:24:08 -08:00
pktcdvd.c block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
ps3disk.c ps3disk: add error handling support for add_disk() 2021-10-30 11:03:37 -06:00
ps3vram.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
rbd.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
sunvdc.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
swim3.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
sx8.c block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
virtio_blk.c block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
xen-blkfront.c block: remove GENHD_FL_CD 2021-11-29 06:35:21 -07:00
z2ram.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00