Linux EXT4 FS development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: arzuagapozosergio@gmail.com
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH v6] ext4: bound xattr journal credits to transaction limit
Date: Wed, 25 Nov 2026 06:23:27 +0000	[thread overview]
Message-ID: <sashiko-outbox-232680@kernel.org> (raw)
In-Reply-To: <20261125060131.10328-1-arzuagapozosergio@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests/ext4: shared_block_reuses_same_ea_inode stores
  xattr in ibody
--

commit 7a62229bf92048e6830756e7f4a7119dee79e887
Author: Ryuji Hiroshi <arzuagapozosergio@gmail.com>

ext4: bound xattr journal credits to transaction limit

This commit drops obsolete ea_inode release credits from the xattr credit
estimate, bounds the estimate against the journal transaction limit, drops
provisional ea_inode references when reusing a cached xattr block, and adds
an ext4 selftest.

Link: https://syzbot.org/bug?extid=25d45c0bd716f2b794a7

> diff --git a/tools/testing/selftests/filesystems/ext4/ext4_xattr_journal_credits.c b/tools/testing/selftests/filesystems/ext4/ext4_xattr_journal_credits.c
> new file mode 100644
> index 0000000000000..4cf51eed24ade
> --- /dev/null
> +++ b/tools/testing/selftests/filesystems/ext4/ext4_xattr_journal_credits.c

[ ... ]

> +TEST_F(ext4_xattr_journal_credits, shared_block_reuses_same_ea_inode)
> +{
> +	create_test_file(_metadata, self->shared_a);
> +	create_test_file(_metadata, self->shared_b);
> +	memset(self->value, 0x7e, LARGE_VALUE_SIZE);
> +	self->value[0] = 0x42;
> +
> +	ASSERT_EQ(0, setxattr(self->shared_a, large_name, self->value,
> +			      LARGE_VALUE_SIZE, XATTR_CREATE));
> +	ASSERT_EQ(0, setxattr(self->shared_b, large_name, self->value,
> +			      LARGE_VALUE_SIZE, XATTR_CREATE));
> +	check_xattr_value(_metadata, self->shared_a, large_name, self->value,
> +			  LARGE_VALUE_SIZE, self->readback);
> +	check_xattr_value(_metadata, self->shared_b, large_name, self->value,
> +			  LARGE_VALUE_SIZE, self->readback);
> +
> +	/* Clone the shared block, then deduplicate back to the original block. */
> +	ASSERT_EQ(0, setxattr(self->shared_a, large_name, self->value,
> +			      LARGE_VALUE_SIZE, XATTR_REPLACE));

[Severity: Medium]
Does shared_block_reuses_same_ea_inode actually allocate or share an
external xattr block?

Because the value is stored in an ea_inode (i.in_inode = 1), only the
36-byte xattr entry is placed in the xattr table.  Since
ext4_xattr_journal_credits.sh formats the filesystem with -I 256 (leaving
88 bytes of in-inode ibody space) and both test files have empty ibodies,
ext4_xattr_ibody_set() succeeds on both XATTR_CREATE calls and the
XATTR_REPLACE call without ever reaching ext4_xattr_block_set().  Filling
the in-inode xattr space on both files first (or formatting with -I 128)
would force large_name into a shared external xattr block so the
provisional ea_inode reference-drop path in ext4_xattr_block_set() is
exercised.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125060131.10328-1-arzuagapozosergio@gmail.com?part=1

  reply	other threads:[~2026-11-25  6:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  7:53 [PATCH] ext4: bound xattr journal credits to transaction limit arzuagapozosergio
2026-11-22  8:09 ` sashiko-bot
2026-11-22  8:49 ` [PATCH v2] " arzuagapozosergio
2026-11-22  9:09   ` sashiko-bot
2026-11-22  9:37   ` [PATCH v3] " arzuagapozosergio
2026-11-22  9:53     ` sashiko-bot
2026-11-24 12:38     ` Jan Kara
2026-11-25  4:51     ` [PATCH v4] " arzuagapozosergio
2026-11-25  5:09       ` sashiko-bot
2026-11-25  5:19       ` [PATCH v5] " arzuagapozosergio
2026-11-25  5:39         ` sashiko-bot
2026-11-25  6:01         ` [PATCH v6] " arzuagapozosergio
2026-11-25  6:23           ` sashiko-bot [this message]
2026-11-25  6:30           ` [PATCH v7] " arzuagapozosergio

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=sashiko-outbox-232680@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arzuagapozosergio@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tytso@mit.edu \
    /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