linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Jingbo Xu <jefflexu@linux.alibaba.com>,
	xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com,
	linux-erofs@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/5] erofs: introduce erofs_xattr_iter_fixup_aligned() helper
Date: Tue, 30 May 2023 11:47:18 +0800	[thread overview]
Message-ID: <77ed16d5-4e75-0d9d-5a11-0d26573f8b9c@linux.alibaba.com> (raw)
In-Reply-To: <6e7b2c58-0bb4-e008-a157-3d83ac33bf81@linux.alibaba.com>



On 2023/5/30 11:42, Jingbo Xu wrote:
> 
> 
> On 5/29/23 3:41 PM, Gao Xiang wrote:
>> Hi,
>>
>> On 2023/5/18 10:45, Jingbo Xu wrote:
>>> Introduce erofs_xattr_iter_fixup_aligned() helper where
>>> it.ofs <= EROFS_BLKSIZ is mandatory.
>>>
>>> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
>>> ---
>>>    fs/erofs/xattr.c | 79 +++++++++++++++++++++---------------------------
>>>    1 file changed, 35 insertions(+), 44 deletions(-)
>>>
>>> diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c
>>> index bbfe7ce170d2..b79be2a556ba 100644
>>> --- a/fs/erofs/xattr.c
>>> +++ b/fs/erofs/xattr.c
>>> @@ -29,6 +29,28 @@ struct xattr_iter {
>>>        unsigned int ofs;
>>>    };
>>>    +static inline int erofs_xattr_iter_fixup(struct xattr_iter *it)
>>> +{
>>> +    if (it->ofs < it->sb->s_blocksize)
>>> +        return 0;
>>> +
>>> +    it->blkaddr += erofs_blknr(it->sb, it->ofs);
>>> +    it->kaddr = erofs_read_metabuf(&it->buf, it->sb, it->blkaddr,
>>> EROFS_KMAP);
>>
>> could we use a new buf interface to init_metabuf at once?
> 
> As discussed offline, I think the following unified API is preferred:
> 
> ```
> int erofs_xattr_iter_fixup(struct xattr_iter *it, bool nospan)
> 
> {
>      if (it->ofs < it->sb->s_blocksize)
>          return 0;
> 
>      if (nospan && it->ofs != it->sb->s_blocksize) {
> 	DBG_BUGON(1);
> 	return -EFSCORRUPTED;
>      }
> 
>      ...
> }
> ```

Yeah, could you send the next version for this?

Thanks,
Gao Xiang

> 

  reply	other threads:[~2023-05-30  3:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  2:45 [PATCH v3 0/5] erofs: cleanup of xattr handling Jingbo Xu
2023-05-18  2:45 ` [PATCH v3 1/5] erofs: introduce erofs_xattr_iter_fixup_aligned() helper Jingbo Xu
2023-05-29  7:41   ` Gao Xiang
2023-05-30  3:42     ` Jingbo Xu
2023-05-30  3:47       ` Gao Xiang [this message]
2023-05-18  2:45 ` [PATCH v3 2/5] erofs: unify xattr_iter structures Jingbo Xu
2023-05-30  3:55   ` Gao Xiang
2023-05-18  2:45 ` [PATCH v3 3/5] erofs: make the size of read data stored in buffer_ofs Jingbo Xu
2023-05-18  2:45 ` [PATCH v3 4/5] erofs: unify inline/share xattr iterators for listxattr/getxattr Jingbo Xu
2023-05-18  2:45 ` [PATCH v3 5/5] erofs: use separate xattr parsers " Jingbo Xu

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=77ed16d5-4e75-0d9d-5a11-0d26573f8b9c@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=huyue2@coolpad.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@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).