From: Mark Fasheh <mfasheh@suse.de>
To: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] fstests: btrfs: add test for qgroup handle de-refer
Date: Tue, 31 May 2016 12:51:42 -0700 [thread overview]
Message-ID: <20160531195142.GA7633@wotan.suse.de> (raw)
In-Reply-To: <1464660234-14562-1-git-send-email-lufq.fnst@cn.fujitsu.com>
Thanks for this test.
On Tue, May 31, 2016 at 10:03:54AM +0800, Lu Fengqi wrote:
> +echo "Start balance" >>$seqres.full
> +_btrfs_stress_balance -d $SCRATCH_MNT >/dev/null 2>&1 &
> +balance_pid=$!
> +
> +# 30s is enough to trigger bug
> +sleep $((30*$TIME_FACTOR))
> +kill $fsstress_pid $balance_pid
> +wait
> +
> +# kill _btrfs_stress_balance can't end balance, so call btrfs balance cancel
> +# to cancel running or paused balance.
> +$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
> +
> +rm -rf $SCRATCH_MNT/*
> +_run_btrfs_util_prog filesystem sync $SCRATCH_MNT
> +units=`_btrfs_qgroup_units`
> +$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' | \
> + $AWK_PROG '{print $2" "$3}'
Wouldn't it be better here to just have btrfsck check for inconsistencies?
If you look at tests/btrfs/122 this is what I mean:
+# generate a qgroup report and look for inconsistent groups
+$BTRFS_UTIL_PROG check --qgroup-report $SCRATCH_DEV 2>&1 | \
+ grep -q -E "Counts for qgroup.*are different"
+if [ $? -ne 0 ]; then
+ status=0
+fi
That way we're not keying on some specific value showing up but instead that
qgroup validation passes (which is really what we want to test).
Thanks,
--Mark
--
Mark Fasheh
next prev parent reply other threads:[~2016-05-31 19:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 2:03 [PATCH] fstests: btrfs: add test for qgroup handle de-refer Lu Fengqi
2016-05-31 7:39 ` Filipe Manana
[not found] ` <14be2210-cf79-56c1-d549-2fd5ccae86e2@cn.fujitsu.com>
2016-05-31 9:18 ` Filipe Manana
2016-05-31 9:28 ` luke
2016-05-31 19:51 ` Mark Fasheh [this message]
2016-06-01 3:30 ` luke
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=20160531195142.GA7633@wotan.suse.de \
--to=mfasheh@suse.de \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=lufq.fnst@cn.fujitsu.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