From: Zorro Lang <zlang@kernel.org>
To: Filipe Manana <fdmanana@kernel.org>
Cc: Qu Wenruo <wqu@suse.com>,
fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] generic: test replacing a xattr with a larger value
Date: Sun, 27 Sep 2026 19:44:02 +0800 [thread overview]
Message-ID: <arkBaZIY8xt0iSgI@zlang-mailbox> (raw)
In-Reply-To: <CAL3q7H6NE1VyYffJj5rdZGdmU2FQz5i_wv7oF8ZhQqRq8eOuXQ@mail.gmail.com>
On Sat, Sep 26, 2026 at 07:19:46PM +0100, Filipe Manana wrote:
> On Sat, Sep 26, 2026 at 6:58 AM Qu Wenruo <wqu@suse.com> wrote:
> >
> >
> >
> > 在 2026/9/26 02:46, fdmanana@kernel.org 写道:
> > > From: Filipe Manana <fdmanana@suse.com>
> > >
> > > Test that replacing a xattr's value with a larger value works. This is a
> > > test that exercises a specific scenario on btrfs where two xattrs are
> > > stored in the same item, and for that to happen their names must result
> > > in the same crc32c hash.
> > >
> > > This was recently fixed by the following patch:
> > >
> > > "btrfs: fix xattr replace when multiple xattrs are packed in the same item"
> > >
> > > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> >
> > Missing the "---" line, which makes b4 include the digest and changelog.
>
> Looks like I may have accidentally deleted it.
> Maybe Zorro can add it when he picks the patch.
Sure, done!
>
> Thanks.
>
> >
> > Otherwise looks good to me.
> >
> > Reviewed-by: Qu Wenruo <wqu@suse.com>
> >
> > Thanks,
> > Qu
> >
> > >
> > > V2: Fix missing _ on _fixed_by_fs_commit call.
> > >
> > > tests/generic/806 | 43 +++++++++++++++++++++++++++++++++++++++++++
> > > tests/generic/806.out | 11 +++++++++++
> > > 2 files changed, 54 insertions(+)
> > > create mode 100755 tests/generic/806
> > > create mode 100644 tests/generic/806.out
> > >
> > > diff --git a/tests/generic/806 b/tests/generic/806
> > > new file mode 100755
> > > index 00000000..1fcf0145
> > > --- /dev/null
> > > +++ b/tests/generic/806
> > > @@ -0,0 +1,43 @@
> > > +#! /bin/bash
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +# Copyright (c) 2026 SUSE S.A. All Rights Reserved.
> > > +#
> > > +# FS QA Test 806
> > > +#
> > > +# Test replacing a xattr's value with a larger value.
> > > +#
> > > +. ./common/preamble
> > > +_begin_fstest auto quick metadata attr
> > > +
> > > +. ./common/filter
> > > +. ./common/attr
> > > +
> > > +_require_scratch
> > > +_require_attrs
> > > +
> > > +_fixed_by_fs_commit btrfs xxxxxxxxxxxx \
> > > + "btrfs: fix xattr replace when multiple xattrs are packed in the same item"
> > > +
> > > +_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
> > > +_scratch_mount
> > > +
> > > +touch $SCRATCH_MNT/testfile
> > > +
> > > +# Add two xattrs that, on btrfs, have the same hash (crc32c) for their name
> > > +# and therefore are packed into the same btrfs_dir_item.
> > > +$SETFATTR_PROG -n user.foobar -v 123 $SCRATCH_MNT/testfile
> > > +$SETFATTR_PROG -n user.WvG1c1Td -v qwerty $SCRATCH_MNT/testfile
> > > +
> > > +# Verify the xattrs are present.
> > > +echo "xattrs before:"
> > > +_getfattr --absolute-names --dump $SCRATCH_MNT/testfile | _filter_scratch
> > > +
> > > +# Now replace the value of the foobar xattr with a significantly larger value.
> > > +$SETFATTR_PROG -n user.foobar -v abcdefghijklmnopqrstuvwxyz $SCRATCH_MNT/testfile
> > > +
> > > +# Check the xattrs have the expected values.
> > > +echo "xattrs after:"
> > > +_getfattr --absolute-names --dump $SCRATCH_MNT/testfile | _filter_scratch
> > > +
> > > +# success, all done
> > > +_exit 0
> > > diff --git a/tests/generic/806.out b/tests/generic/806.out
> > > new file mode 100644
> > > index 00000000..620a953e
> > > --- /dev/null
> > > +++ b/tests/generic/806.out
> > > @@ -0,0 +1,11 @@
> > > +QA output created by 806
> > > +xattrs before:
> > > +# file: SCRATCH_MNT/testfile
> > > +user.WvG1c1Td="qwerty"
> > > +user.foobar="123"
> > > +
> > > +xattrs after:
> > > +# file: SCRATCH_MNT/testfile
> > > +user.WvG1c1Td="qwerty"
> > > +user.foobar="abcdefghijklmnopqrstuvwxyz"
> > > +
> >
prev parent reply other threads:[~2026-09-27 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 16:50 [PATCH] generic: test replacing a xattr with a larger value fdmanana
2026-09-25 17:16 ` [PATCH v2] " fdmanana
2026-09-25 20:05 ` Darrick J. Wong
2026-09-26 5:58 ` Qu Wenruo
2026-09-26 18:19 ` Filipe Manana
2026-09-27 11:44 ` Zorro Lang [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=arkBaZIY8xt0iSgI@zlang-mailbox \
--to=zlang@kernel.org \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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