From: "Darrick J. Wong" <djwong@kernel.org>
To: Wang Jianjian <wangjianjian3@huawei.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org, wangjianjian0@foxmail.com
Subject: Re: [PATCH] ext4,fiemap: Add inode offset for xattr fiemap
Date: Wed, 17 Dec 2025 08:35:21 -0800 [thread overview]
Message-ID: <20251217163521.GO94594@frogsfrogsfrogs> (raw)
In-Reply-To: <20251217084708.494396-1-wangjianjian3@huawei.com>
On Wed, Dec 17, 2025 at 04:47:08PM +0800, Wang Jianjian wrote:
> For xattr in inode, need add inode offset in this block?
> Also, there is one problem, if we have xattrs both in inode
> and block, current implementation will only return xattr inode fiemap.
> Is this by design?
I don't think there's much value in reporting the inline xattrs via
FIEMAP because user programs can't directly access that area anyway.
The only reason (AFAICT) for reporting the external xattr block is for
building a map of lost data given a report of localized media failure.
(FIEMAP only being useful for debugging and after-the-shatter forensics)
> Signed-off-by: Wang Jianjian <wangjianjian3@huawei.com>
> ---
> fs/ext4/extents.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 2cf5759ba689..a16bfc75345d 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -5043,6 +5043,7 @@ static int ext4_iomap_xattr_fiemap(struct inode *inode, struct iomap *iomap)
> if (error)
> return error;
> physical = (__u64)iloc.bh->b_blocknr << blockbits;
> + physical += iloc.offset;
Also it doesn't make sense to add the address of the external block to
the inode offset.
--D
> offset = EXT4_GOOD_OLD_INODE_SIZE +
> EXT4_I(inode)->i_extra_isize;
> physical += offset;
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2025-12-17 16:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 8:47 [PATCH] ext4,fiemap: Add inode offset for xattr fiemap Wang Jianjian
2025-12-17 16:35 ` Darrick J. Wong [this message]
2025-12-18 1:05 ` wangjianjian (C)
2025-12-18 23:36 ` Darrick J. Wong
2025-12-19 0:50 ` wangjianjian (C)
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=20251217163521.GO94594@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wangjianjian0@foxmail.com \
--cc=wangjianjian3@huawei.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