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: <a08a091b-78d1-4fb1-982c-c51d9dff8f06@kernel.org>
Date: Sat, 27 Apr 2024 09:49:35 +0800
From: Chao Yu <chao@...nel.org>
To: Daeho Jeong <daeho43@...il.com>
Cc: jaegeuk@...nel.org, linux-f2fs-devel@...ts.sourceforge.net,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] f2fs: zone: fix to don't trigger OPU on pinfile for
 direct IO

On 2024/4/26 22:14, Daeho Jeong wrote:
> On Fri, Apr 26, 2024 at 3:35 AM Chao Yu <chao@...nel.org> wrote:
>>
>> Otherwise, it breaks pinfile's sematics.
>>
>> Cc: Daeho Jeong <daeho43@...il.com>
>> Signed-off-by: Chao Yu <chao@...nel.org>
>> ---
>>   fs/f2fs/data.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>> index bee1e45f76b8..e29000d83d52 100644
>> --- a/fs/f2fs/data.c
>> +++ b/fs/f2fs/data.c
>> @@ -1596,7 +1596,8 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag)
>>
>>          /* use out-place-update for direct IO under LFS mode */
>>          if (map->m_may_create &&
>> -           (is_hole || (f2fs_lfs_mode(sbi) && flag == F2FS_GET_BLOCK_DIO))) {
>> +           (is_hole || (flag == F2FS_GET_BLOCK_DIO && (f2fs_lfs_mode(sbi) &&
>> +           (!f2fs_sb_has_blkzoned(sbi) || !f2fs_is_pinned_file(inode)))))) {
>>                  if (unlikely(f2fs_cp_error(sbi))) {
>>                          err = -EIO;
>>                          goto sync_out;
>> --
>> 2.40.1
> 
> So, we block overwrite io for the pinfile here.

I guess you mean we blocked append write for pinfile, right?

> 
> static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
> 
> {
> ...
>          if (f2fs_is_pinned_file(inode) &&
>              !f2fs_overwrite_io(inode, pos, count)) {

If !f2fs_overwrite_io() is true, it means it may trigger append write on
pinfile?

Thanks,

>                  ret = -EIO;
>                  goto out_unlock;
>          }
> 
> 
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ