]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix surprise removal for drivers calling blk_set_queue_dying
authorChristoph Hellwig <hch@lst.de>
Thu, 17 Feb 2022 07:52:31 +0000 (08:52 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Feb 2022 14:54:03 +0000 (07:54 -0700)
commitf58764a200d06e6bfb8d4bd2395fd98ce668ef97
tree8081b612885ee3f9f8a61e1a72620eecc22e72ca
parenta6c7de9ddb8f5801c5481a8f6366ef689d9e16c6
block: fix surprise removal for drivers calling blk_set_queue_dying

Various block drivers call blk_set_queue_dying to mark a disk as dead due
to surprise removal events, but since commit b44b1c0ab7ff that doesn't
work given that the GD_DEAD flag needs to be set to stop I/O.

Replace the driver calls to blk_set_queue_dying with a new (and properly
documented) blk_mark_disk_dead API, and fold blk_set_queue_dying into the
only remaining caller.

Fixes: b44b1c0ab7ff ("block: drain file system I/O on del_gendisk")
Reported-by: Markus Blöchl <markus.bloechl@ipetronik.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Link: https://lore.kernel.org/r/20220217075231.1140-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/genhd.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/rbd.c
drivers/block/xen-blkfront.c
drivers/md/dm.c
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
include/linux/blkdev.h