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: <3b1dcd45-efa6-4aad-9cd4-3302a29eb093@huaweicloud.com>
Date: Sat, 8 Feb 2025 11:12:57 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: Benjamin Marzinski <bmarzins@...hat.com>
Cc: linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org,
 linux-block@...r.kernel.org, dm-devel@...ts.linux.dev,
 linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
 linux-kernel@...r.kernel.org, hch@....de, tytso@....edu, djwong@...nel.org,
 yi.zhang@...wei.com, chengzhihao1@...wei.com, yukuai3@...wei.com,
 yangerkun@...wei.com
Subject: Re: [RFC PATCH v2 4/8] dm: add BLK_FEAT_WRITE_ZEROES_UNMAP support

On 2025/2/8 6:14, Benjamin Marzinski wrote:
> On Wed, Jan 15, 2025 at 07:46:33PM +0800, Zhang Yi wrote:
>> From: Zhang Yi <yi.zhang@...wei.com>
>>
>> Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by
>> default. This feature shall be disabled if any underlying device does
>> not support it.
>>
>> Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
>> ---
>>  drivers/md/dm-table.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
>> index bd8b796ae683..58cce31bcc1e 100644
>> --- a/drivers/md/dm-table.c
>> +++ b/drivers/md/dm-table.c
>> @@ -598,7 +598,8 @@ int dm_split_args(int *argc, char ***argvp, char *input)
>>  static void dm_set_stacking_limits(struct queue_limits *limits)
>>  {
>>  	blk_set_stacking_limits(limits);
>> -	limits->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL;
>> +	limits->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL |
>> +			    BLK_FEAT_WRITE_ZEROES_UNMAP;
>>  }
>>  
> 
> dm_table_set_restrictions() can set limits->max_write_zeroes_sectors to
> 0, and it's called after dm_calculate_queue_limits(), which calls
> blk_stack_limits(). Just to avoid having the BLK_FEAT_WRITE_ZEROES_UNMAP
> still set while a device's max_write_zeroes_sectors is 0, it seems like
> you would want to clear it as well if dm_table_set_restrictions() sets
> limits->max_write_zeroes_sectors to 0.
> 

Hi, Ben!

Yeah, right. Thanks for pointing this out, and I also checked other
instances in dm where max_write_zeroes_sectors is set to 0, and it seems
we should also clear BLK_FEAT_WRITE_ZEROES_UNMAP in
disable_write_zeroes() as well.

Thanks,
Yi.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ