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] [thread-next>] [day] [month] [year] [list]
Message-ID: <f59c3015-7029-9cd0-f5f0-087dfc1f24d0@huaweicloud.com>
Date: Mon, 6 May 2024 20:33:06 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: Dave Chinner <david@...morbit.com>
Cc: linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org, tytso@....edu,
 adilger.kernel@...ger.ca, jack@...e.cz, ritesh.list@...il.com,
 hch@...radead.org, djwong@...nel.org, willy@...radead.org,
 zokeefe@...gle.com, yi.zhang@...wei.com, chengzhihao1@...wei.com,
 yukuai3@...wei.com, wangkefeng.wang@...wei.com
Subject: Re: [RFC PATCH v4 27/34] ext4: implement zero_range iomap path

On 2024/5/1 17:40, Dave Chinner wrote:
> On Wed, Apr 10, 2024 at 10:29:41PM +0800, Zhang Yi wrote:
>> From: Zhang Yi <yi.zhang@...wei.com>
>>
>> Add ext4_iomap_zero_range() for the zero_range iomap path, it zero out
>> the mapped blocks, all work have been done in iomap_zero_range(), so
>> call it directly.
>>
>> Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
>> ---
>>  fs/ext4/inode.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
>> index 9d694c780007..5af3b8acf1b9 100644
>> --- a/fs/ext4/inode.c
>> +++ b/fs/ext4/inode.c
>> @@ -4144,6 +4144,13 @@ static int __ext4_block_zero_page_range(handle_t *handle,
>>  	return err;
>>  }
>>  
>> +static int ext4_iomap_zero_range(struct inode *inode,
>> +				 loff_t from, loff_t length)
>> +{
>> +	return iomap_zero_range(inode, from, length, NULL,
>> +				&ext4_iomap_buffered_read_ops);
>> +}
> 
> Zeroing is a buffered write operation, not a buffered read
> operation. It runs though iomap_write_begin(), so needs all the
> stale iomap detection stuff to be set up for correct operation.
> 

Yeah, right, thanks for point this out. Although we can guarantee
that the zeroing is a partial block overwrite and no need to
allocate new blocks on ext4, use ext4_iomap_buffered_read_ops is
not appropriate, I'll use write ops instead.

Thanks,
Yi.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ