linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: "何云蕾(Yunlei he)" <heyunlei@oppo.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: not allowed to set file both cold and hot
Date: Tue, 20 Jun 2023 15:54:54 +0800	[thread overview]
Message-ID: <f7a44e66-6fde-a178-d29e-7684bcbc454e@kernel.org> (raw)
In-Reply-To: <6c527e97-c4a6-dc58-13fb-516f77e5e068@oppo.com>

On 2023/6/20 10:42, 何云蕾(Yunlei he) wrote:
> 
> On 2023/6/20 8:33, Chao Yu wrote:
>> On 2023/6/13 16:52, Yunlei He wrote:
>>> File set both cold and hot advise bit is confusion, so
>>> return EINVAL to avoid this case.
>>>
>>> Signed-off-by: Yunlei He <heyunlei@oppo.com>
>>> ---
>>>   fs/f2fs/xattr.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
>>> index 213805d3592c..917f3ac9f1a1 100644
>>> --- a/fs/f2fs/xattr.c
>>> +++ b/fs/f2fs/xattr.c
>>> @@ -127,6 +127,9 @@ static int f2fs_xattr_advise_set(const struct xattr_handler *handler,
>>>                  return -EINVAL;
>>>
>>>          new_advise = new_advise & FADVISE_MODIFIABLE_BITS;
>>> +       if ((new_advise & FADVISE_COLD_BIT) && (new_advise & FADVISE_HOT_BIT))
>>> +               return -EINVAL;
>>
>> Yunlei,
>>
>> What about the below case:
>>
>> 1. f2fs_xattr_advise_set(FADVISE_COLD_BIT)
>> 2. f2fs_xattr_advise_set(FADVISE_HOT_BIT)
> 
> Hi,  Chao,
> 
>      I test this case work well with this patch,  case below will return -EINVAL:
> 
>      f2fs_xattr_advise_set(FADVISE_COLD_BIT | FADVISE_HOT_BIT)

Correct, I missed to check below statement.

new_advise |= old_advise & ~FADVISE_MODIFIABLE_BITS;

Anyway, the patch looks good to me.

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


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

  reply	other threads:[~2023-06-20  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  8:52 [f2fs-dev] [PATCH] f2fs: not allowed to set file both cold and hot Yunlei He via Linux-f2fs-devel
2023-06-20  0:33 ` Chao Yu
2023-06-20  2:42   ` 何云蕾(Yunlei he) via Linux-f2fs-devel
2023-06-20  7:54     ` Chao Yu [this message]
2023-06-23 19:07       ` Jaegeuk Kim
     [not found]         ` <b638931a-ab81-a6ef-be5b-57848f27aba7@oppo.com>
2023-06-26 13:16           ` Jaegeuk Kim

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=f7a44e66-6fde-a178-d29e-7684bcbc454e@kernel.org \
    --to=chao@kernel.org \
    --cc=heyunlei@oppo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).