From: Gao Xiang <xiang@kernel.org>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>
Cc: xiang@kernel.org, chao@kernel.org, zbestahu@gmail.com,
jefflexu@163.com, dhavale@google.com, hongbohbli@tencent.com,
guochunhai@vivo.com, linux-erofs@lists.ozlabs.org,
linux-kernel@vger.kernel.org, zhanxusheng@xiaomi.com
Subject: Re: [PATCH] erofs: reset buf->off in erofs_init_metabuf()
Date: Wed, 11 Nov 2026 20:32:49 +0100 [thread overview]
Message-ID: <avTC4Q5Ps2xBxslw@MacBookPro.fritz.box> (raw)
In-Reply-To: <20261111141529.719166-1-zhanxusheng1024@gmail.com>
On Wed, Nov 11, 2026 at 10:15:29PM +0800, Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
>
> erofs_init_metabuf() sets buf->off only for the block device and keeps
> the old value when it switches to the metabox or the managed cache.
> erofs_bread() adds buf->off to every offset, so the result depends on
> how the buffer was last initialized.
>
> getxattr and listxattr init the same buffer twice, for the inline and
> the shared xattrs, with in_metabox taken from different places. On a
> block device mount with fsoffset=, if the inode is outside the metabox
> and COMPAT_SHARED_EA_IN_METABOX is set, the shared xattrs are read at
> their metabox offset plus fsoffset. The same image mounted file-backed
> returns the right values.
>
> Reset buf->off on every init.
>
> Fixes: 414091322c63 ("erofs: implement metadata compression")
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
Thanks,
Gao Xiang
prev parent reply other threads:[~2026-11-11 19:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 14:15 Zhan Xusheng
2026-11-11 19:32 ` Gao Xiang [this message]
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=avTC4Q5Ps2xBxslw@MacBookPro.fritz.box \
--to=xiang@kernel.org \
--cc=chao@kernel.org \
--cc=dhavale@google.com \
--cc=guochunhai@vivo.com \
--cc=hongbohbli@tencent.com \
--cc=jefflexu@163.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zbestahu@gmail.com \
--cc=zhanxusheng1024@gmail.com \
--cc=zhanxusheng@xiaomi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®