summaryrefslogtreecommitdiffstats
path: root/block/blk-zoned.c
diff options
context:
space:
mode:
authorLongPing Wei <weilongping@oppo.com>2024-11-07 03:04:41 +0100
committerJens Axboe <axboe@kernel.dk>2024-12-10 21:24:24 +0100
commit790eb09e59709a1ffc1c64fe4aae2789120851b0 (patch)
tree3613a77cc8cbca47ecbe13e2990348a9243c51c3 /block/blk-zoned.c
parentblk-cgroup: Fix UAF in blkcg_unpin_online() (diff)
downloadlinux-790eb09e59709a1ffc1c64fe4aae2789120851b0.tar.xz
linux-790eb09e59709a1ffc1c64fe4aae2789120851b0.zip
block: get wp_offset by bdev_offset_from_zone_start
Call bdev_offset_from_zone_start() instead of open-coding it. Fixes: dd291d77cc90 ("block: Introduce zone write plugging") Signed-off-by: LongPing Wei <weilongping@oppo.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241107020439.1644577-1-weilongping@oppo.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-zoned.c')
-rw-r--r--block/blk-zoned.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 77f12fc2086f..84da1eadff64 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -555,7 +555,7 @@ again:
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;