This is a note to let you know that I've just added the patch titled block: stop setting the nomerges flags in blk_cleanup_queue to the 5.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: block-stop-setting-the-nomerges-flags-in-blk_cleanup.patch and it can be found in the queue-5.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 5968f92808e5a6ceca57cd07186e2de9aff90f08 Author: Christoph Hellwig <hch@xxxxxx> Date: Sun Jun 19 08:05:50 2022 +0200 block: stop setting the nomerges flags in blk_cleanup_queue [ Upstream commit 0e3534022f26ae51f7cf28347a253230604b6f4e ] These flags only apply to file system I/O, and all file system I/O is already drained by del_gendisk and thus can't be in progress when blk_cleanup_queue is called. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Hannes Reinecke <hare@xxxxxxx> Link: https://lore.kernel.org/r/20220619060552.1850436-5-hch@xxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Stable-dep-of: 8fe4ce5836e9 ("scsi: core: Fix a use-after-free") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/block/blk-core.c b/block/blk-core.c index 76f070c3a3b0..b8083decc07f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -304,9 +304,6 @@ void blk_cleanup_queue(struct request_queue *q) blk_queue_flag_set(QUEUE_FLAG_DYING, q); blk_queue_start_drain(q); - blk_queue_flag_set(QUEUE_FLAG_NOMERGES, q); - blk_queue_flag_set(QUEUE_FLAG_NOXMERGES, q); - /* * Drain all requests queued before DYING marking. Set DEAD flag to * prevent that blk_mq_run_hw_queues() accesses the hardware queues