[PATCH v5 5/6] dm-stripe: limit chunk_sectors to the stripe size

John Garry posted 6 patches 3 months ago
There is a newer version of this series
[PATCH v5 5/6] dm-stripe: limit chunk_sectors to the stripe size
Posted by John Garry 3 months ago
Same as done for raid0, set chunk_sectors limit to appropriately set the
atomic write size limit.

Setting chunk_sectors limit in this way overrides the stacked limit
already calculated based on the bottom device limits. This is ok, as
when any bios are sent to the bottom devices, the block layer will still
respect the bottom device chunk_sectors.

Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 drivers/md/dm-stripe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index a7dc04bd55e5..5bbbdf8fc1bd 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -458,6 +458,7 @@ static void stripe_io_hints(struct dm_target *ti,
 	struct stripe_c *sc = ti->private;
 	unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
 
+	limits->chunk_sectors = sc->chunk_size;
 	limits->io_min = chunk_size;
 	limits->io_opt = chunk_size * sc->stripes;
 }
-- 
2.43.5
Re: [PATCH v5 5/6] dm-stripe: limit chunk_sectors to the stripe size
Posted by Mikulas Patocka 2 months, 4 weeks ago

On Wed, 9 Jul 2025, John Garry wrote:

> Same as done for raid0, set chunk_sectors limit to appropriately set the
> atomic write size limit.
> 
> Setting chunk_sectors limit in this way overrides the stacked limit
> already calculated based on the bottom device limits. This is ok, as
> when any bios are sent to the bottom devices, the block layer will still
> respect the bottom device chunk_sectors.
> 
> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
> Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
> Signed-off-by: John Garry <john.g.garry@oracle.com>
> ---
>  drivers/md/dm-stripe.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
> index a7dc04bd55e5..5bbbdf8fc1bd 100644
> --- a/drivers/md/dm-stripe.c
> +++ b/drivers/md/dm-stripe.c
> @@ -458,6 +458,7 @@ static void stripe_io_hints(struct dm_target *ti,
>  	struct stripe_c *sc = ti->private;
>  	unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
>  
> +	limits->chunk_sectors = sc->chunk_size;
>  	limits->io_min = chunk_size;
>  	limits->io_opt = chunk_size * sc->stripes;
>  }
> -- 
> 2.43.5

Hi

This will conflict with the current dm code in linux-dm.git. Should I fix 
up the conflict and commit it through the linux-dm git?

Mikulas
Re: [PATCH v5 5/6] dm-stripe: limit chunk_sectors to the stripe size
Posted by John Garry 2 months, 4 weeks ago
On 10/07/2025 16:03, Mikulas Patocka wrote:
> 
> 
> On Wed, 9 Jul 2025, John Garry wrote:
> 
>> Same as done for raid0, set chunk_sectors limit to appropriately set the
>> atomic write size limit.
>>
>> Setting chunk_sectors limit in this way overrides the stacked limit
>> already calculated based on the bottom device limits. This is ok, as
>> when any bios are sent to the bottom devices, the block layer will still
>> respect the bottom device chunk_sectors.
>>
>> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
>> Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
>> Signed-off-by: John Garry <john.g.garry@oracle.com>
>> ---
>>   drivers/md/dm-stripe.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
>> index a7dc04bd55e5..5bbbdf8fc1bd 100644
>> --- a/drivers/md/dm-stripe.c
>> +++ b/drivers/md/dm-stripe.c
>> @@ -458,6 +458,7 @@ static void stripe_io_hints(struct dm_target *ti,
>>   	struct stripe_c *sc = ti->private;
>>   	unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
>>   
>> +	limits->chunk_sectors = sc->chunk_size;
>>   	limits->io_min = chunk_size;
>>   	limits->io_opt = chunk_size * sc->stripes;
>>   }
>> -- 
>> 2.43.5
> 
> Hi
> 
> This will conflict with the current dm code in linux-dm.git. Should I fix
> up the conflict and commit it through the linux-dm git?

I was hoping that Jens would take this series through the block tree, so 
I will let him comment.

But I think that taking this patch separately though linux-dm would 
create an intermediate breakage for atomics functionality for dm-stripe 
on the block tree. Not many are using it yet, so not an utterly terrible 
a way to go.

Thanks,
John