This is a note to let you know that I've just added the patch titled block: get wp_offset by bdev_offset_from_zone_start to the 6.12-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-get-wp_offset-by-bdev_offset_from_zone_start.patch and it can be found in the queue-6.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 042d8ff457039fc227e730d8680c6349d77c5853 Author: LongPing Wei <weilongping@xxxxxxxx> Date: Thu Nov 7 10:04:41 2024 +0800 block: get wp_offset by bdev_offset_from_zone_start [ Upstream commit 790eb09e59709a1ffc1c64fe4aae2789120851b0 ] Call bdev_offset_from_zone_start() instead of open-coding it. Fixes: dd291d77cc90 ("block: Introduce zone write plugging") Signed-off-by: LongPing Wei <weilongping@xxxxxxxx> Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx> Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx> Link: https://lore.kernel.org/r/20241107020439.1644577-1-weilongping@xxxxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 6d21693f39b7..767bcbce74fa 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -568,7 +568,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk, spin_lock_init(&zwplug->lock); zwplug->flags = 0; zwplug->zone_no = zno; - zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors - 1); + zwplug->wp_offset = bdev_offset_from_zone_start(disk->part0, sector); bio_list_init(&zwplug->bio_list); INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work); zwplug->disk = disk;