All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: fdmanana@kernel.org, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] generic: test replacing a xattr with a larger value
Date: Sat, 26 Sep 2026 15:28:40 +0930	[thread overview]
Message-ID: <a76bf043-e379-4e7a-883b-cd2bfc1a5c05@suse.com> (raw)
In-Reply-To: <7d2caec7b8ecd95ad63fcbbc7e1cc1c84ee50d7f.1790356355.git.fdmanana@suse.com>



在 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.

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"
> +


  parent reply	other threads:[~2026-09-26  5:58 UTC|newest]

Thread overview: 7+ 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:15 ` [PATCH v2] " fdmanana
2026-09-25 17:16   ` fdmanana
2026-09-25 20:05   ` Darrick J. Wong
2026-09-26  5:58   ` Qu Wenruo [this message]
2026-09-26 18:19     ` Filipe Manana
2026-09-27 11:44       ` Zorro Lang

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=a76bf043-e379-4e7a-883b-cd2bfc1a5c05@suse.com \
    --to=wqu@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.