This is a note to let you know that I've just added the patch titled block: pass a gendisk to blk_queue_clear_zone_settings to the 5.15-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-pass-a-gendisk-to-blk_queue_clear_zone_setting.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 1011c6b47b0dfafc6fa92f182e76b1b713a14fee Author: Christoph Hellwig <hch@xxxxxx> Date: Wed Jul 6 09:03:41 2022 +0200 block: pass a gendisk to blk_queue_clear_zone_settings [ Upstream commit b3c72f8138b5f967a9fa527af84b35018897aba3 ] Switch to a gendisk based API in preparation for moving all zone related fields from the request_queue to the gendisk. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx> Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Link: https://lore.kernel.org/r/20220706070350.1703384-8-hch@xxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Stable-dep-of: 47fe1c3064c6 ("block: fix revalidate performance regression") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/block/blk-settings.c b/block/blk-settings.c index b880c70e22e4e..8b84b4f126966 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -913,7 +913,7 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model) blk_queue_zone_write_granularity(q, queue_logical_block_size(q)); } else { - blk_queue_clear_zone_settings(q); + disk_clear_zone_settings(disk); } } EXPORT_SYMBOL_GPL(blk_queue_set_zoned); diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 774ecc598bee2..2629ec5d977b4 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -630,8 +630,10 @@ int blk_revalidate_disk_zones(struct gendisk *disk, } EXPORT_SYMBOL_GPL(blk_revalidate_disk_zones); -void blk_queue_clear_zone_settings(struct request_queue *q) +void disk_clear_zone_settings(struct gendisk *disk) { + struct request_queue *q = disk->queue; + blk_mq_freeze_queue(q); blk_queue_free_zone_bitmaps(q); diff --git a/block/blk.h b/block/blk.h index aab72194d2266..336bdb35466ee 100644 --- a/block/blk.h +++ b/block/blk.h @@ -343,10 +343,10 @@ struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp); #ifdef CONFIG_BLK_DEV_ZONED void blk_queue_free_zone_bitmaps(struct request_queue *q); -void blk_queue_clear_zone_settings(struct request_queue *q); +void disk_clear_zone_settings(struct gendisk *disk); #else static inline void blk_queue_free_zone_bitmaps(struct request_queue *q) {} -static inline void blk_queue_clear_zone_settings(struct request_queue *q) {} +static inline void disk_clear_zone_settings(struct gendisk *disk) {} #endif int blk_alloc_ext_minor(void);