diff mbox

xfstests: btrfs: 022: add a quota rescan -w to wait rescan finished.

Message ID 1433315455-814-1-git-send-email-yangds.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yang Dongsheng June 3, 2015, 7:10 a.m. UTC
When we enable quota, btrfs will rescan quota numbers. We need
to wait the rescan finished before any more operations on btrfs
qgroups. Otherwith, the new btrfs-progs would WARN out:

WARNING: Rescan is running, qgroup data may be incorrect.

It would make btrfs/022 failed.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 tests/btrfs/022 | 1 +
 1 file changed, 1 insertion(+)

Comments

Yang Dongsheng June 3, 2015, 7:12 a.m. UTC | #1
Hi Filip,

Qu is off duty this week, would you please try this patch here?

Thanx
Yang

On 06/03/2015 03:10 PM, Dongsheng Yang wrote:
> When we enable quota, btrfs will rescan quota numbers. We need
> to wait the rescan finished before any more operations on btrfs
> qgroups. Otherwith, the new btrfs-progs would WARN out:
>
> WARNING: Rescan is running, qgroup data may be incorrect.
>
> It would make btrfs/022 failed.
>
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
>   tests/btrfs/022 | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/tests/btrfs/022 b/tests/btrfs/022
> index 5c1a82d..56d4f3d 100755
> --- a/tests/btrfs/022
> +++ b/tests/btrfs/022
> @@ -51,6 +51,7 @@ _basic_test()
>   {
>   	_run_btrfs_util_prog subvolume create $SCRATCH_MNT/a
>   	_run_btrfs_util_prog quota enable $SCRATCH_MNT/a
> +	_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
>   	subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
>   	$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \
>   		$seqres.full 2>&1
>

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Filipe Manana June 3, 2015, 3:53 p.m. UTC | #2
On Wed, Jun 3, 2015 at 8:10 AM, Dongsheng Yang
<yangds.fnst@cn.fujitsu.com> wrote:
> When we enable quota, btrfs will rescan quota numbers. We need
> to wait the rescan finished before any more operations on btrfs
> qgroups. Otherwith, the new btrfs-progs would WARN out:
>
> WARNING: Rescan is running, qgroup data may be incorrect.
>
> It would make btrfs/022 failed.
>
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>

Thanks, it works and it makes sense.

> ---
>  tests/btrfs/022 | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/btrfs/022 b/tests/btrfs/022
> index 5c1a82d..56d4f3d 100755
> --- a/tests/btrfs/022
> +++ b/tests/btrfs/022
> @@ -51,6 +51,7 @@ _basic_test()
>  {
>         _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a
>         _run_btrfs_util_prog quota enable $SCRATCH_MNT/a
> +       _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
>         subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
>         $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \
>                 $seqres.full 2>&1
> --
> 1.8.4.2
>
diff mbox

Patch

diff --git a/tests/btrfs/022 b/tests/btrfs/022
index 5c1a82d..56d4f3d 100755
--- a/tests/btrfs/022
+++ b/tests/btrfs/022
@@ -51,6 +51,7 @@  _basic_test()
 {
 	_run_btrfs_util_prog subvolume create $SCRATCH_MNT/a
 	_run_btrfs_util_prog quota enable $SCRATCH_MNT/a
+	_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
 	subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
 	$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \
 		$seqres.full 2>&1