From: Qu Wenruo <wqu@suse.com>
To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] fstests: generic/062: avoid warning from polluting the golden output
Date: Tue, 7 Jul 2026 18:40:30 +0930 [thread overview]
Message-ID: <be633a11-6870-429f-a463-508099b96886@suse.com> (raw)
In-Reply-To: <7df0f6d0323abed08ffb1f40775474e4b39fef19.1783414762.git.wqu@suse.com>
Please discard this one.
Avinesh has already submitted a better solution doing the runtime check.
Thanks,
Qu
在 2026/7/7 18:29, Qu Wenruo 写道:
> [FAILURE]
> With the latest setfattr (provided by attr 2.6.0), the test case
> generic/062 will fail like the following:
>
> FSTYP -- btrfs
> PLATFORM -- Linux/aarch64 btrfs-aarch64 7.2.0-rc1-custom-64k+ #22 SMP PREEMPT_DYNAMIC Tue Jul 7 16:05:57 ACST 2026
> MKFS_OPTIONS -- -O bgt -K /dev/mapper/test-scratch1
> MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch
>
> generic/062 1s ... - output mismatch (see /home/adam/xfstests-dev/results//generic/062.out.bad)
> --- tests/generic/062.out 2024-04-25 18:13:45.101553098 +0930
> +++ /home/adam/xfstests-dev/results//generic/062.out.bad 2026-07-07 18:22:12.384539920 +0930
> @@ -649,6 +649,7 @@
> SCRATCH_MNT/lnk
> SCRATCH_MNT/reg
> *** restore everything
> +Warning: option --restore=file is unsafe without option -P (--physical) as it traverses symbolic links in pathnames
> *** compare before and after backups
>
> *** unmount
> ...
> (Run 'diff -u /home/adam/xfstests-dev/tests/generic/062.out /home/adam/xfstests-dev/results//generic/062.out.bad' to see the entire diff)
> Ran: generic/062
> Failures: generic/062
> Failed 1 of 1 tests
>
> [CAUSE]
> That output is a warning from the latest attr, introduced by attr commit
> 3fb06b9ba314 ("harden setfattr --restore").
>
> There is also a compile time flag to toggle that warning.
>
> [FIX]
> Since we have no way to know if the setfattr command from the running
> environment has that hardening or not, and the way to disable that
> warning is to use "-P" option, which does not exist in older versions,
> just redirect the stdout into seqres.full to avoid pollution.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> tests/generic/062 | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tests/generic/062 b/tests/generic/062
> index 896590403fda..faeb9650c608 100755
> --- a/tests/generic/062
> +++ b/tests/generic/062
> @@ -186,7 +186,9 @@ _create_test_bed
> _extend_test_bed
>
> echo "*** restore everything"
> -setfattr -h --restore=$tmp.backup1
> +# For attr 2.6.0, --restore= without -P will output a warning.
> +# Redirect it to avoid polluting the golden output.
> +setfattr -h --restore=$tmp.backup1 >> $seqres.full
> _backup $tmp.backup2
>
> echo "AFTER RESTORE" >>$seqres.full
prev parent reply other threads:[~2026-07-07 9:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 8:59 [PATCH] fstests: generic/062: avoid warning from polluting the golden output Qu Wenruo
2026-07-07 9:10 ` Qu Wenruo [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=be633a11-6870-429f-a463-508099b96886@suse.com \
--to=wqu@suse.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox