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: <409b20e7-b030-2998-df66-b188b313f8f8@huaweicloud.com>
Date: Wed, 29 Oct 2025 10:37:45 +0800
From: Li Nan <linan666@...weicloud.com>
To: yukuai@...as.com, corbet@....net, song@...nel.org, hare@...e.de,
 xni@...hat.com
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-raid@...r.kernel.org, linan666@...weicloud.com, yangerkun@...wei.com,
 yi.zhang@...wei.com
Subject: Re: [PATCH v7 3/4] md/raid0: Move queue limit setup before r0conf
 initialization



在 2025/10/28 20:12, Yu Kuai 写道:
> Hi,
> 
> 在 2025/10/27 15:29, linan122@...wei.com 写道:
>> From: Li Nan <linan122@...wei.com>
>>
>> Prepare for making logical blocksize configurable.
>>
>> Move raid0_set_limits() before create_strip_zones(). It is safe as fields
>> modified in create_strip_zones() do not involve mddev configuration, and
>> rdev modifications there are not used in raid0_set_limits().
>>
>> 'blksize' in create_strip_zones() fetches mddev's logical block size. This
>> change has no impact until logical block size becomes configurable.
>>
>> Signed-off-by: Li Nan <linan122@...wei.com>
>> ---
>>    drivers/md/raid0.c | 13 +++++++------
>>    1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
>> index e443e478645a..49477b560cc9 100644
>> --- a/drivers/md/raid0.c
>> +++ b/drivers/md/raid0.c
>> @@ -68,7 +68,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
>>    	struct strip_zone *zone;
>>    	int cnt;
>>    	struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
>> -	unsigned blksize = 512;
>> +	unsigned int blksize = queue_logical_block_size(mddev->gendisk->queue);
>>    
>>    	*private_conf = ERR_PTR(-ENOMEM);
>>    	if (!conf)
> 
> I think the following setting of blksize can be removed as well.
> 
> blksize = max(blksize, ...)
> 
> Thanks,
> Kuai
> 

Agree. I will remove it later. Thanks for your review.

>> @@ -405,6 +405,12 @@ static int raid0_run(struct mddev *mddev)
>>    	if (md_check_no_bitmap(mddev))
>>    		return -EINVAL;
>>    
>> +	if (!mddev_is_dm(mddev)) {
>> +		ret = raid0_set_limits(mddev);
>> +		if (ret)
>> +			return ret;
>> +	}
>> +
>>    	/* if private is not null, we are here after takeover */
>>    	if (mddev->private == NULL) {
>>    		ret = create_strip_zones(mddev, &conf);
>> @@ -413,11 +419,6 @@ static int raid0_run(struct mddev *mddev)
>>    		mddev->private = conf;
>>    	}
>>    	conf = mddev->private;
>> -	if (!mddev_is_dm(mddev)) {
>> -		ret = raid0_set_limits(mddev);
>> -		if (ret)
>> -			return ret;
>> -	}
>>    
>>    	/* calculate array device size */
>>    	md_set_array_sectors(mddev, raid0_size(mddev, 0, 0));
> 
> .

-- 
Thanks,
Nan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ