All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Zhiguo Niu <niuzhiguo84@gmail.com>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO
Date: Sat, 27 Apr 2024 09:50:42 +0800	[thread overview]
Message-ID: <ef4788ca-1336-4adf-ac82-b5f2619bb83f@kernel.org> (raw)
In-Reply-To: <CAHJ8P3+G8ooBt7Atw62wkSWBS0Xzx7J5eE4tPOKWd8_rjp=KNg@mail.gmail.com>

On 2024/4/26 19:30, Zhiguo Niu wrote:
> Dear Chao,
> 
> On Fri, Apr 26, 2024 at 6:37 PM Chao Yu <chao@kernel.org> wrote:
>>
>> Otherwise, it breaks pinfile's sematics.
>>
>> Cc: Daeho Jeong <daeho43@gmail.com>
>> Signed-off-by: Chao Yu <chao@kernel.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)))))) {
> Excuse me I a little question, should pin files not be written in OPU
> mode regardless of device type(conventional or  zone)?

Agreed, so it looks we need remove !f2fs_sb_has_blkzoned condition here...

Thanks,

> thanks!
>>                  if (unlikely(f2fs_cp_error(sbi))) {
>>                          err = -EIO;
>>                          goto sync_out;
>> --
>> 2.40.1
>>
>>
>>
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Zhiguo Niu <niuzhiguo84@gmail.com>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO
Date: Sat, 27 Apr 2024 09:50:42 +0800	[thread overview]
Message-ID: <ef4788ca-1336-4adf-ac82-b5f2619bb83f@kernel.org> (raw)
In-Reply-To: <CAHJ8P3+G8ooBt7Atw62wkSWBS0Xzx7J5eE4tPOKWd8_rjp=KNg@mail.gmail.com>

On 2024/4/26 19:30, Zhiguo Niu wrote:
> Dear Chao,
> 
> On Fri, Apr 26, 2024 at 6:37 PM Chao Yu <chao@kernel.org> wrote:
>>
>> Otherwise, it breaks pinfile's sematics.
>>
>> Cc: Daeho Jeong <daeho43@gmail.com>
>> Signed-off-by: Chao Yu <chao@kernel.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)))))) {
> Excuse me I a little question, should pin files not be written in OPU
> mode regardless of device type(conventional or  zone)?

Agreed, so it looks we need remove !f2fs_sb_has_blkzoned condition here...

Thanks,

> thanks!
>>                  if (unlikely(f2fs_cp_error(sbi))) {
>>                          err = -EIO;
>>                          goto sync_out;
>> --
>> 2.40.1
>>
>>
>>
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2024-04-27  1:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 10:35 [f2fs-dev] [PATCH] f2fs: zone: fix to don't trigger OPU on pinfile for direct IO Chao Yu
2024-04-26 10:35 ` Chao Yu
2024-04-26 11:30 ` [f2fs-dev] " Zhiguo Niu
2024-04-26 11:30   ` Zhiguo Niu
2024-04-27  1:50   ` Chao Yu [this message]
2024-04-27  1:50     ` Chao Yu
2024-04-26 14:14 ` Daeho Jeong
2024-04-26 14:14   ` Daeho Jeong
2024-04-27  1:49   ` [f2fs-dev] " Chao Yu
2024-04-27  1:49     ` Chao Yu
2024-04-27 19:50     ` [f2fs-dev] " Daeho Jeong
2024-04-27 19:50       ` Daeho Jeong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef4788ca-1336-4adf-ac82-b5f2619bb83f@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niuzhiguo84@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.