THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
Subsystems (2)
PATCH 1/1 THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
Signed-off-by Atharva Tiwari <[email protected]>
--- block/blk-zoned.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-zoned.c +2 -1
@@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Zoned block device handling
@@ -530,7 +531,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;
Signature · 1 line
2.43.0
Quoted 2 lines · Atharva Tiwari
Signed-off-by Atharva Tiwari <[email protected]>---
You at least need to state why.
Quoted 21 lines
block/blk-zoned.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)block/blk-zoned.c +2
-1@@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Zoned block device handling @@ -530,7 +531,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;
Quoted 5 lines · Johannes Thumshirn
Quoted 2 lines · Atharva Tiwari
Signed-off-by Atharva Tiwari <[email protected]>---
You at least need to state why.
Which will be hard to prove given that we atually check that it can't during disk registration.
Quoted 11 lines · Christoph Hellwig
Quoted 5 lines · Johannes Thumshirn
Quoted 2 lines · Atharva Tiwari
Signed-off-by Atharva Tiwari <[email protected]>---
You at least need to state why.
Which will be hard to prove given that we atually check that it can't during disk registration.
I know, so I wanted the explanation ;)
block/blk-zoned.c static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk, · line 537
Quoted 9 lines · Atharva Tiwari
block/blk-zoned.c +1
-1@@ -530,7 +531,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;
The above looks like a duplicate of this patch:
https://lore.kernel.org/linux-block/[email protected]/