* [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
@ 2024-12-10 6:23 Atharva Tiwari
2024-12-10 7:09 ` Johannes Thumshirn
2024-12-10 20:22 ` Bart Van Assche
0 siblings, 2 replies; 5+ messages in thread
From: Atharva Tiwari @ 2024-12-10 6:23 UTC (permalink / raw)
Cc: evepolonium, Jens Axboe, linux-block, linux-kernel
Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
---
block/blk-zoned.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 263e28b72053..60f8bddf9295 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -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;
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
2024-12-10 6:23 [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2 Atharva Tiwari
@ 2024-12-10 7:09 ` Johannes Thumshirn
2024-12-10 7:11 ` Christoph Hellwig
2024-12-10 20:22 ` Bart Van Assche
1 sibling, 1 reply; 5+ messages in thread
From: Johannes Thumshirn @ 2024-12-10 7:09 UTC (permalink / raw)
To: Atharva Tiwari; +Cc: Jens Axboe, linux-block, linux-kernel
On 10.12.24 07:24, Atharva Tiwari wrote:
> Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
> ---
You at least need to state why.
> block/blk-zoned.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index 263e28b72053..60f8bddf9295 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
2024-12-10 7:09 ` Johannes Thumshirn
@ 2024-12-10 7:11 ` Christoph Hellwig
2024-12-10 7:13 ` Johannes Thumshirn
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2024-12-10 7:11 UTC (permalink / raw)
To: Johannes Thumshirn; +Cc: Atharva Tiwari, Jens Axboe, linux-block, linux-kernel
On Tue, Dec 10, 2024 at 07:09:00AM +0000, Johannes Thumshirn wrote:
> On 10.12.24 07:24, Atharva Tiwari wrote:
> > Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
> > ---
>
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
2024-12-10 7:11 ` Christoph Hellwig
@ 2024-12-10 7:13 ` Johannes Thumshirn
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2024-12-10 7:13 UTC (permalink / raw)
To: hch; +Cc: Atharva Tiwari, Jens Axboe, linux-block, linux-kernel
On 10.12.24 08:11, Christoph Hellwig wrote:
> On Tue, Dec 10, 2024 at 07:09:00AM +0000, Johannes Thumshirn wrote:
>> On 10.12.24 07:24, Atharva Tiwari wrote:
>>> Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
>>> ---
>>
>> 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 ;)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2
2024-12-10 6:23 [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2 Atharva Tiwari
2024-12-10 7:09 ` Johannes Thumshirn
@ 2024-12-10 20:22 ` Bart Van Assche
1 sibling, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2024-12-10 20:22 UTC (permalink / raw)
To: Atharva Tiwari; +Cc: Jens Axboe, linux-block, linux-kernel
On 12/9/24 10:23 PM, Atharva Tiwari wrote:
> @@ -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/20241107020439.1644577-1-weilongping@oppo.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-12-10 20:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-10 6:23 [PATCH] THE INITIAL VALUE OF wp_offset MAY BE NOT THE POWER OF 2 Atharva Tiwari
2024-12-10 7:09 ` Johannes Thumshirn
2024-12-10 7:11 ` Christoph Hellwig
2024-12-10 7:13 ` Johannes Thumshirn
2024-12-10 20:22 ` Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®