lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f06aa274-c442-478e-85c2-40d9a07c7a5a@oracle.com>
Date: Thu, 12 Jun 2025 11:01:05 +0100
From: John Garry <john.g.garry@...cle.com>
To: Nilay Shroff <nilay@...ux.ibm.com>, agk@...hat.com, snitzer@...nel.org,
        mpatocka@...hat.com, song@...nel.org, yukuai3@...wei.com, hch@....de,
        axboe@...nel.dk
Cc: dm-devel@...ts.linux.dev, linux-kernel@...r.kernel.org,
        linux-raid@...r.kernel.org, linux-block@...r.kernel.org,
        ojaswin@...ux.ibm.com, martin.petersen@...cle.com
Subject: Re: [PATCH RFC 3/4] dm-stripe: limit chunk_sectors to the stripe size

On 06/06/2025 16:16, Nilay Shroff wrote:
>> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
>> index 24a857ff6d0b..4f1f7173740c 100644
>> --- a/drivers/md/dm-table.c
>> +++ b/drivers/md/dm-table.c
>> @@ -430,6 +430,10 @@ static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
>>   		return 0;
>>   	}
>>   
>> +	/* For striped types, limit the chunk_sectors to the chunk size */
>> +	if (dm_target_supports_striped(ti->type))
>> +		limits->chunk_sectors = len >> SECTOR_SHIFT;
>> +
> I think here "len" refers to the total size of dm target and not the
> chunk sectors. So we need to modify this and take into account chunk sectors..
> We can get chunk sectors, for example, like this:
> 
> 	struct stripe_c *sc = ti->private;
> 	limits->chunk_sectors = sc->chunk_size;

right

I find that the terminology used in the dm code for stripe width and 
size a bit confusing.

> 
> But again struct stripe_c is private to dm-stripe.c and so we can't access it
> here directly in dm-table.c Better we add a new callback function for dm target
> type under struct target_type and then use that callback to get chunk sector.
> 
> struct target_type stripe_target = {
>          ...
>          .chunk_sectors = stripe_chunk_sectors,
>          ...
> }


Please see reply to Mikulas on this same topic.

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ