From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs-progs: fsck-tests: check warning for seed and sprouted filesystems
Date: Tue, 26 Apr 2022 06:44:04 +0800 [thread overview]
Message-ID: <57d6192b-e1fd-bd14-d869-d03559c34eb1@gmx.com> (raw)
In-Reply-To: <20220425170408.GR18596@twin.jikos.cz>
On 2022/4/26 01:04, David Sterba wrote:
> On Sun, Apr 17, 2022 at 03:30:36PM +0800, Qu Wenruo wrote:
>> Previously we had a bug that btrfs check would report false warning for
>> a sprouted filesystem.
>>
>> So this patch will add a new test case to make sure neither seed nor
>> and sprouted filesystem will cause such false warning.
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>> .../fsck-tests/057-seed-false-alerts/test.sh | 51 +++++++++++++++++++
>> 1 file changed, 51 insertions(+)
>> create mode 100755 tests/fsck-tests/057-seed-false-alerts/test.sh
>>
>> diff --git a/tests/fsck-tests/057-seed-false-alerts/test.sh b/tests/fsck-tests/057-seed-false-alerts/test.sh
>> new file mode 100755
>> index 000000000000..3a442c1202d0
>> --- /dev/null
>> +++ b/tests/fsck-tests/057-seed-false-alerts/test.sh
>> @@ -0,0 +1,51 @@
>> +#!/bin/bash
>> +#
>> +# Make sure "btrfs check" won't report false alerts on sprouted filesystems
>> +#
>> +
>> +source "$TEST_TOP/common"
>> +
>> +check_prereq btrfs
>> +check_prereq mkfs.btrfs
>> +check_prereq btrfstune
>> +check_global_prereq losetup
>> +
>> +setup_loopdevs 2
>> +prepare_loopdevs
>> +dev1=${loopdevs[1]}
>> +dev2=${loopdevs[2]}
>> +TEST_DEV=$dev1
>> +
>> +setup_root_helper
>> +
>> +run_check $SUDO_HELPERS "$TOP/mkfs.btrfs" -f $dev1
> ^^^^^^^^^^^^^
>
> It's $SUDO_HELPER, otherwise it does not work, also please quote all
> shell variables, everywhere.
>
>> +run_check $SUDO_HELPERS "$TOP/btrfstune" -S1 $dev1
>> +run_check_mount_test_dev
>> +run_check $SUDO_HELPERS "$TOP/btrfs" device add -f $dev2 $TEST_MNT
>> +
>> +# Here we can not use umount helper, as it uses the seed device to do the
>> +# umount. We need to manually unmout using the mount point
>> +run_check $SUDO_HELPERS umount $TEST_MNT
>> +
>> +seed_output=$(_mktemp --tmpdir btrfs-progs-seed-check-stdout.XXXXXX)
>
> This won't work as intended, there's a helper _mktemp_dir that creates a
> temporary directory, otherwise --tmpdir is interpreted as the direcotry
> name.
My bad, it should be mktemp without the "_" prefix, just like what we
did in all the run* helpers.
And I'm not expected to create a directory, thus I don't need to
_mktemp_dir.
Thanks,
Qu
next prev parent reply other threads:[~2022-04-25 22:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-17 7:30 [PATCH 0/2] btrfs-progs: fsck: fix false warning on sprouted filesystems Qu Wenruo
2022-04-17 7:30 ` [PATCH 1/2] btrfs-progs: check: fix wrong total bytes check for seed device Qu Wenruo
2022-04-17 9:33 ` Su Yue
2022-04-19 16:18 ` David Sterba
2022-04-17 7:30 ` [PATCH 2/2] btrfs-progs: fsck-tests: check warning for seed and sprouted filesystems Qu Wenruo
2022-04-25 17:04 ` David Sterba
2022-04-25 22:44 ` Qu Wenruo [this message]
2022-04-25 22:42 ` David Sterba
2022-04-25 23:06 ` Qu Wenruo
2022-04-25 23:15 ` David Sterba
2022-04-25 17:06 ` [PATCH 0/2] btrfs-progs: fsck: fix false warning on " David Sterba
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=57d6192b-e1fd-bd14-d869-d03559c34eb1@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--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