FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] fstests: btrfs/179 call sync qgroup counts
@ 2020-02-12  9:35 Anand Jain
  2020-02-12 14:20 ` Qu Wenruo
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Jain @ 2020-02-12  9:35 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs

On some systems btrfs/179 fails because the check finds that there is
difference in the qgroup counts.

So as the intention of the test case is to test any hang like situation
during heavy snapshot create/delete operation with quota enabled, so
make sure the qgroup counts are consistent at the end of the test case,
so to make the check happy.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v2: Use subvolume sync at the end of the test case.
    Patch title changed.

 tests/btrfs/179 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/btrfs/179 b/tests/btrfs/179
index 4a24ea419a7e..8795d59c01f8 100755
--- a/tests/btrfs/179
+++ b/tests/btrfs/179
@@ -109,6 +109,15 @@ wait $snapshot_pid
 kill $delete_pid
 wait $delete_pid
 
+# By the async nature of qgroup tree scan and subvolume delete, the latest
+# qgroup counts at the time of umount might not be upto date, if it isn't
+# then the check will report the difference in count. The difference in
+# qgroup counts are anyway updated in the following mount, so it is not a
+# real issue that this test case is trying to verify. So make sure the
+# qgroup counts are in sync before unmount happens.
+
+$BTRFS_UTIL_PROG subvolume sync $SCRATCH_MNT >> $seqres.full
+
 # success, all done
 echo "Silence is golden"
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] fstests: btrfs/179 call sync qgroup counts
  2020-02-12  9:35 [PATCH v2] fstests: btrfs/179 call sync qgroup counts Anand Jain
@ 2020-02-12 14:20 ` Qu Wenruo
  0 siblings, 0 replies; 2+ messages in thread
From: Qu Wenruo @ 2020-02-12 14:20 UTC (permalink / raw)
  To: Anand Jain, fstests; +Cc: linux-btrfs

[-- Attachment #1.1: Type: text/plain, Size: 1738 bytes --]



On 2020/2/12 下午5:35, Anand Jain wrote:
> On some systems btrfs/179 fails because the check finds that there is
> difference in the qgroup counts.
> 
> So as the intention of the test case is to test any hang like situation
> during heavy snapshot create/delete operation with quota enabled, so
> make sure the qgroup counts are consistent at the end of the test case,
> so to make the check happy.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> v2: Use subvolume sync at the end of the test case.
>     Patch title changed.
> 
>  tests/btrfs/179 | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/tests/btrfs/179 b/tests/btrfs/179
> index 4a24ea419a7e..8795d59c01f8 100755
> --- a/tests/btrfs/179
> +++ b/tests/btrfs/179
> @@ -109,6 +109,15 @@ wait $snapshot_pid
>  kill $delete_pid
>  wait $delete_pid
>  
> +# By the async nature of qgroup tree scan and subvolume delete, the latest
> +# qgroup counts at the time of umount might not be upto date, if it isn't
> +# then the check will report the difference in count. The difference in
> +# qgroup counts are anyway updated in the following mount, so it is not a
> +# real issue that this test case is trying to verify. So make sure the
> +# qgroup counts are in sync before unmount happens.

It could be a little easier. Just btrfs-progs has a bug accounting
qgroups for subvolume being dropped.
Btrfs-progs tends to account more extents than it should be.

The subvolume sync would be a workaround for it.

Despite the commment, it looks good to me.

Thanks,
Qu

> +
> +$BTRFS_UTIL_PROG subvolume sync $SCRATCH_MNT >> $seqres.full
> +
>  # success, all done
>  echo "Silence is golden"
>  
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12  9:35 [PATCH v2] fstests: btrfs/179 call sync qgroup counts Anand Jain
2020-02-12 14:20 ` Qu Wenruo

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git