[PATCH 1/2] block: fix surprise removal for drivers calling blk_set_queue_dying

Hannes Reinecke hare at suse.de
Wed Feb 16 07:32:20 PST 2022


On 2/16/22 16:09, Christoph Hellwig wrote:
> Various block drivers call blk_set_queue_dying to mark a disk as dead due
> to surprise removal events, but since commit 8e141f9eb803 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: 8e141f9eb803 ("block: drain file system I/O on del_gendisk")
> Reported-by: Markus Blöchl <markus.bloechl at ipetronik.com>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>   block/blk-core.c                  | 18 +++++++++++++-----
>   drivers/block/mtip32xx/mtip32xx.c |  2 +-
>   drivers/block/rbd.c               |  2 +-
>   drivers/block/xen-blkfront.c      |  2 +-
>   drivers/md/dm.c                   |  2 +-
>   drivers/nvme/host/core.c          |  2 +-
>   drivers/nvme/host/multipath.c     |  2 +-
>   include/linux/blkdev.h            |  3 ++-
>   8 files changed, 21 insertions(+), 12 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare at suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer



More information about the Linux-nvme mailing list