* [PATCH v2 2/3] xfstests/btrfs: add basic functional test for btrfs quota groups
2014-03-10 3:44 [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Wang Shilong
@ 2014-03-10 3:44 ` Wang Shilong
2014-03-10 19:46 ` Josef Bacik
2014-03-10 3:44 ` [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations Wang Shilong
` (3 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Wang Shilong @ 2014-03-10 3:44 UTC (permalink / raw)
To: xfs; +Cc: linux-btrfs
Add missing test for btrfs quota groups feature,test idea is to create
a parent qgroup that groups some subvolume groups, we try to write
some data into every subvolume and then check if we exceed parent
qgroup's limit size.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
v1->v2:
switch into new helper _run_btrfs_util_prog()
use 'XFS_IO_PROG' instead of 'dd'
---
tests/btrfs/042 | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/btrfs/042.out | 2 ++
tests/btrfs/group | 1 +
3 files changed, 98 insertions(+)
create mode 100755 tests/btrfs/042
create mode 100644 tests/btrfs/042.out
diff --git a/tests/btrfs/042 b/tests/btrfs/042
new file mode 100755
index 0000000..498ccc9
--- /dev/null
+++ b/tests/btrfs/042
@@ -0,0 +1,95 @@
+#! /bin/bash
+# FS QA Test No. 042
+#
+# Test the basic functionality of Quota groups
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2014 Fujitsu. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+
+run_check _scratch_mkfs
+run_check _scratch_mount
+
+LIMIT_SIZE=$((10 * 1024 * 1024))
+
+_run_btrfs_util_prog quota enable $SCRATCH_MNT
+_run_btrfs_util_prog qgroup create 1/1 $SCRATCH_MNT
+_run_btrfs_util_prog qgroup limit $LIMIT_SIZE 1/1 $SCRATCH_MNT
+
+for i in `seq 10 -1 1`; do
+ #add newly created subvolume qgroup to it's parent qgroup
+ _run_btrfs_util_prog subvolume create -i 1/1 \
+ $SCRATCH_MNT/subv_$i
+done
+
+#try to write data into every subvolume
+for i in `seq 10 -1 1`; do
+ $XFS_IO_PROG -f -d -c 'pwrite -b 4k 0 10m' $SCRATCH_MNT/subv_$i/data \
+ >> /dev/null 2>&1 &
+done
+
+wait
+_run_btrfs_util_prog filesystem sync $SCRATCH_MNT \
+ >>$seqres.full 2>&1
+
+total_written=0
+#calculate every subvolume's data.
+for i in `seq 10 -1 1`; do
+ #we may fail to create the file, skip this subvolume
+ test -f $SCRATCH_MNT/subv_$i || continue
+
+ filesize=`du -b $SCRATCH_MNT/subv_$i/data | $AWK_PROG '{print $1}'`
+ if [ $filesize -gt $LIMIT_SIZE ];then
+ _fail "subv_$i/data size should be less than $LIMIT_SIZE"
+ fi
+ total_written=$(($total_written+$filesize))
+done
+
+#check if total written exceeds limit
+if [ $total_written -gt $LIMIT_SIZE ];then
+ _fail "total written should be less than $LIMIT_SIZE"
+fi
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/042.out b/tests/btrfs/042.out
new file mode 100644
index 0000000..85eac7a
--- /dev/null
+++ b/tests/btrfs/042.out
@@ -0,0 +1,2 @@
+QA output created by 042
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index fd0193c..1037761 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -44,3 +44,4 @@
039 auto quick
040 auto quick
041 auto quick
+042 auto quick
--
1.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/3] xfstests/btrfs: add basic functional test for btrfs quota groups
2014-03-10 3:44 ` [PATCH v2 2/3] xfstests/btrfs: add basic functional test for btrfs quota groups Wang Shilong
@ 2014-03-10 19:46 ` Josef Bacik
0 siblings, 0 replies; 21+ messages in thread
From: Josef Bacik @ 2014-03-10 19:46 UTC (permalink / raw)
To: Wang Shilong, xfs; +Cc: linux-btrfs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/09/2014 11:44 PM, Wang Shilong wrote:
> Add missing test for btrfs quota groups feature,test idea is to
> create a parent qgroup that groups some subvolume groups, we try to
> write some data into every subvolume and then check if we exceed
> parent qgroup's limit size.
>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> ---
> v1->v2: switch into new helper _run_btrfs_util_prog() use
> 'XFS_IO_PROG' instead of 'dd'
Ran fine, looks reasonable
Reviewed-by: Josef Bacik <jbacik@fb.com>
Thanks,
Josef
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTHhaRAAoJEANb+wAKly3BQA8QALiXQci/aiNj70AZ353ATQBI
EseYkX9qmuNfYRfZW1FRCoUdXANCCENkovsxaOvZ2kQlhSG1I1kYzZu+GDA6d8Ah
LquR5XoHoSKP3My3y1tZnmkYcND/Uq2RXxMlPZA5IvulzDDvv3dE+JRn0fcq1Fhp
u3IYyFEt4xtv86uLMdJk2fi1bwhoepdMO3WUnYWnRgcVzI+wlLz5pCryxnn9MZau
0MYwce5nmc3mqlNeMHnfARixI91X5W676kymbKE0+7zEwdXruqckS/MMg4qdESUV
NLkEDkFzE1RM37Yg6VRB+V9R3bP4o5P1lm4evXhAA+fmneqsVWgOSJ+fKYPzsYFr
cJF8V3WSkFlRWQhdsZIb/bSBuZHe2hr9kEshX4uqlX74qEzrWMrN+NeixzpVC/1f
k4yj+9RqBXNW6QfBQW7rj40JUVCb6yltDjpaHbUagQwN1wAcOBDlKYb3KOjJdU1u
wGS0ZRRRx4PJkgFviJoNuv2ZeSaPnUcVvGe3XdbNC6Lh2orzHwopcvEPFVHF5hI6
NgUlxeVhbSXKrAI07V467wZ0voQkpVl/srkLdlZx/4lPdgcTA3DSNv5NbBdPRWmD
g6atdMQkSN4f+NxJDVSU7Kr9CBczQm7fms794DljX0Q1vMBBB9XO+pxlnnIaaaSf
5a8HFdn6+pvKxTU+ETUJ
=SHWF
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations
2014-03-10 3:44 [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Wang Shilong
2014-03-10 3:44 ` [PATCH v2 2/3] xfstests/btrfs: add basic functional test for btrfs quota groups Wang Shilong
@ 2014-03-10 3:44 ` Wang Shilong
2014-03-10 19:48 ` Josef Bacik
2014-03-10 19:43 ` [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Josef Bacik
` (2 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Wang Shilong @ 2014-03-10 3:44 UTC (permalink / raw)
To: xfs; +Cc: linux-btrfs
So this is a stress test for btrfs quota operations. it can also
detect the following commit fixed problem:
4082bd3d73(Btrfs: fix oops when writting dirty qgroups to disk)
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
v1->v2:
switch into new helper _run_btrfs_util_prog()
---
tests/btrfs/043 | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/btrfs/043.out | 2 ++
tests/btrfs/group | 1 +
3 files changed, 79 insertions(+)
create mode 100755 tests/btrfs/043
create mode 100644 tests/btrfs/043.out
diff --git a/tests/btrfs/043 b/tests/btrfs/043
new file mode 100755
index 0000000..d6c4bf3
--- /dev/null
+++ b/tests/btrfs/043
@@ -0,0 +1,76 @@
+#! /bin/bash
+# FS QA Test No. 043
+#
+# stresstest for btrfs quota operations. we run fsstress and quota
+# operations concurrently.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2014 Fujitsu. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+
+_quota_enabled_background()
+{
+ i=1
+ while [ $i -le 5 ]
+ do
+ _run_btrfs_util_prog quota enable $SCRATCH_MNT
+ _run_btrfs_util_prog quota disable $SCRATCH_MNT
+ i=$(($i+1))
+ sleep 1
+ done
+}
+
+MKFS_SIZE=$((1024 * 1024 * 1024))
+run_check _scratch_mkfs_sized $MKFS_SIZE
+run_check _scratch_mount
+
+_quota_enabled_background &
+run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
+ $FSSTRESS_AVOID
+
+run_check _scratch_unmount
+_check_scratch_fs
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/043.out b/tests/btrfs/043.out
new file mode 100644
index 0000000..f90f0a5
--- /dev/null
+++ b/tests/btrfs/043.out
@@ -0,0 +1,2 @@
+QA output created by 043
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index 1037761..fabe3b5 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -45,3 +45,4 @@
040 auto quick
041 auto quick
042 auto quick
+043 auto quick
--
1.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations
2014-03-10 3:44 ` [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations Wang Shilong
@ 2014-03-10 19:48 ` Josef Bacik
2014-03-13 3:12 ` Dave Chinner
0 siblings, 1 reply; 21+ messages in thread
From: Josef Bacik @ 2014-03-10 19:48 UTC (permalink / raw)
To: Wang Shilong, xfs; +Cc: linux-btrfs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/09/2014 11:44 PM, Wang Shilong wrote:
> So this is a stress test for btrfs quota operations. it can also
> detect the following commit fixed problem:
>
> 4082bd3d73(Btrfs: fix oops when writting dirty qgroups to disk)
>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> ---
> v1->v2: switch into new helper _run_btrfs_util_prog() ---
> tests/btrfs/043 | 76
> +++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/btrfs/043.out | 2 ++ tests/btrfs/group | 1 + 3 files
> changed, 79 insertions(+) create mode 100755 tests/btrfs/043 create
> mode 100644 tests/btrfs/043.out
>
> diff --git a/tests/btrfs/043 b/tests/btrfs/043 new file mode
> 100755 index 0000000..d6c4bf3 --- /dev/null +++ b/tests/btrfs/043
> @@ -0,0 +1,76 @@ +#! /bin/bash +# FS QA Test No. 043 +# +#
> stresstest for btrfs quota operations. we run fsstress and quota +#
> operations concurrently. +#
> +#-----------------------------------------------------------------------
>
>
+# Copyright (c) 2014 Fujitsu. All Rights Reserved.
> +# +# This program is free software; you can redistribute it
> and/or +# modify it under the terms of the GNU General Public
> License as +# published by the Free Software Foundation. +# +# This
> program is distributed in the hope that it would be useful, +# but
> WITHOUT ANY WARRANTY; without even the implied warranty of +#
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#
> GNU General Public License for more details. +# +# You should have
> received a copy of the GNU General Public License +# along with
> this program; if not, write the Free Software Foundation, +# Inc.,
> 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> +#-----------------------------------------------------------------------
>
>
+#
> + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output
> created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is
> the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 +
> +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard
> environment, filters and checks +. ./common/rc +. ./common/filter
> + +_supported_fs btrfs +_supported_os Linux +_require_scratch + +rm
> -f $seqres.full + +_quota_enabled_background() +{ + i=1 + while [
> $i -le 5 ] + do + _run_btrfs_util_prog quota enable $SCRATCH_MNT +
> _run_btrfs_util_prog quota disable $SCRATCH_MNT + i=$(($i+1)) +
> sleep 1 + done +} + +MKFS_SIZE=$((1024 * 1024 * 1024)) +run_check
> _scratch_mkfs_sized $MKFS_SIZE +run_check _scratch_mount +
> +_quota_enabled_background & +run_check $FSSTRESS_PROG -d
> $SCRATCH_MNT -w -p 5 -n 1000 \ + $FSSTRESS_AVOID + +run_check
> _scratch_unmount +_check_scratch_fs +
You should probably be doing something to make sure the background
quota stuff exits properly before your script exits, my fio box can
run the fsstress in way less than 5 seconds. Thanks,
Josef
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTHhcbAAoJEANb+wAKly3B5Y0P/3z2IPMHDb95QwtmK0Ehsy8G
meD44ew0yy8f4hMED5VAnHeKEctRfNierXz+pJAKlxvREzbNKIlnTSDLgwYxMCeO
OQruW1Dp6W4WtSNltF8YfIVZqhLksHpkoW7zYrSr+qCZeQsNal61rjqQ2cydWb4u
nCnICJa/KkLT84MW4WrZU+S2RJE7kvfqQoZkXND4rH2Nw9hAaAnF6bK4+ZfvKwni
uDrBl3vdrQWIps304zIGaYxpnheIskeVdEG2AtL/KsCpCuSI/m/yjFsU8w/yTJ64
g4Kbd9l3sTNSfErujeBZ9brEpVRwslUzSnw0u5g5PNABRYsTcnyh+tkelCIMH8MI
2StpONvNXLQeaL2N378/syV4oWvAez6qUtFVFHTCfjKlugxn92juJXQKaS98K4Un
V1+CrJ6cH2bGLjOKVnDsIf8aY77hSuP6Qn/wNMcZvO10ajlpRhFS9FYy12jyoC7M
1aSLX+6R9pk+MvCwFAS+9w2hYTj5ksDhVZWXIwPxK9rQE/NYitNrv+y6QzcF0xhi
udgTPl5XDdtiDWcDabMHEr6ky5gbnz6oiLcRy4V/XHbr9ymInaiB7fhBJ0DOX78m
I19DBe/QIPCGBwFcgKHmadZAudihory6UzMaMkFlzbt4AVjBEYujS7U4LDhFN0lx
UYXoSJdzjA2OZWhUXfdL
=jTbe
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations
2014-03-10 19:48 ` Josef Bacik
@ 2014-03-13 3:12 ` Dave Chinner
2014-03-13 14:02 ` Josef Bacik
0 siblings, 1 reply; 21+ messages in thread
From: Dave Chinner @ 2014-03-13 3:12 UTC (permalink / raw)
To: Josef Bacik; +Cc: Wang Shilong, xfs, linux-btrfs
On Mon, Mar 10, 2014 at 03:48:43PM -0400, Josef Bacik wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 03/09/2014 11:44 PM, Wang Shilong wrote:
> > So this is a stress test for btrfs quota operations. it can also
> > detect the following commit fixed problem:
> >
> > 4082bd3d73(Btrfs: fix oops when writting dirty qgroups to disk)
> >
> > Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> ---
> > v1->v2: switch into new helper _run_btrfs_util_prog() ---
> > tests/btrfs/043 | 76
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++
> > tests/btrfs/043.out | 2 ++ tests/btrfs/group | 1 + 3 files
> > changed, 79 insertions(+) create mode 100755 tests/btrfs/043 create
> > mode 100644 tests/btrfs/043.out
> >
> > diff --git a/tests/btrfs/043 b/tests/btrfs/043 new file mode
> > 100755 index 0000000..d6c4bf3 --- /dev/null +++ b/tests/btrfs/043
> > @@ -0,0 +1,76 @@ +#! /bin/bash +# FS QA Test No. 043 +# +#
> > stresstest for btrfs quota operations. we run fsstress and quota +#
> > operations concurrently. +#
> > +#-----------------------------------------------------------------------
> >
> >
> +# Copyright (c) 2014 Fujitsu. All Rights Reserved.
> > +# +# This program is free software; you can redistribute it
> > and/or +# modify it under the terms of the GNU General Public
> > License as +# published by the Free Software Foundation. +# +# This
> > program is distributed in the hope that it would be useful, +# but
> > WITHOUT ANY WARRANTY; without even the implied warranty of +#
> > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#
> > GNU General Public License for more details. +# +# You should have
> > received a copy of the GNU General Public License +# along with
> > this program; if not, write the Free Software Foundation, +# Inc.,
> > 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> > +#-----------------------------------------------------------------------
> >
> >
> +#
> > + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output
> > created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is
> > the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 +
> > +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard
> > environment, filters and checks +. ./common/rc +. ./common/filter
> > + +_supported_fs btrfs +_supported_os Linux +_require_scratch + +rm
> > -f $seqres.full + +_quota_enabled_background() +{ + i=1 + while [
> > $i -le 5 ] + do + _run_btrfs_util_prog quota enable $SCRATCH_MNT +
> > _run_btrfs_util_prog quota disable $SCRATCH_MNT + i=$(($i+1)) +
> > sleep 1 + done +} + +MKFS_SIZE=$((1024 * 1024 * 1024)) +run_check
> > _scratch_mkfs_sized $MKFS_SIZE +run_check _scratch_mount +
> > +_quota_enabled_background & +run_check $FSSTRESS_PROG -d
> > $SCRATCH_MNT -w -p 5 -n 1000 \ + $FSSTRESS_AVOID + +run_check
> > _scratch_unmount +_check_scratch_fs +
>
> You should probably be doing something to make sure the background
> quota stuff exits properly before your script exits, my fio box can
> run the fsstress in way less than 5 seconds. Thanks,
josef - you might want to have a look at what your mailer is doing
to quoted email ad fix it... ;)
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations
2014-03-13 3:12 ` Dave Chinner
@ 2014-03-13 14:02 ` Josef Bacik
0 siblings, 0 replies; 21+ messages in thread
From: Josef Bacik @ 2014-03-13 14:02 UTC (permalink / raw)
To: Dave Chinner; +Cc: Wang Shilong, xfs, linux-btrfs
On 03/12/2014 11:12 PM, Dave Chinner wrote:
> On Mon, Mar 10, 2014 at 03:48:43PM -0400, Josef Bacik wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>>> So this is a stress test for btrfs quota operations. it can also
>>> detect the following commit fixed problem:
>>>
>>> 4082bd3d73(Btrfs: fix oops when writting dirty qgroups to disk)
>>>
>>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> ---
>>> v1->v2: switch into new helper _run_btrfs_util_prog() ---
>>> tests/btrfs/043 | 76
>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> tests/btrfs/043.out | 2 ++ tests/btrfs/group | 1 + 3 files
>>> changed, 79 insertions(+) create mode 100755 tests/btrfs/043 create
>>> mode 100644 tests/btrfs/043.out
>>>
>>> diff --git a/tests/btrfs/043 b/tests/btrfs/043 new file mode
>>> 100755 index 0000000..d6c4bf3 --- /dev/null +++ b/tests/btrfs/043
>>> @@ -0,0 +1,76 @@ +#! /bin/bash +# FS QA Test No. 043 +# +#
>>> stresstest for btrfs quota operations. we run fsstress and quota +#
>>> operations concurrently. +#
>>> +#-----------------------------------------------------------------------
>>>
>>>
>> +# Copyright (c) 2014 Fujitsu. All Rights Reserved.
>>> +# +# This program is free software; you can redistribute it
>>> and/or +# modify it under the terms of the GNU General Public
>>> License as +# published by the Free Software Foundation. +# +# This
>>> program is distributed in the hope that it would be useful, +# but
>>> WITHOUT ANY WARRANTY; without even the implied warranty of +#
>>> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#
>>> GNU General Public License for more details. +# +# You should have
>>> received a copy of the GNU General Public License +# along with
>>> this program; if not, write the Free Software Foundation, +# Inc.,
>>> 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>>> +#-----------------------------------------------------------------------
>>>
>>>
>> +#
>>> + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output
>>> created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is
>>> the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 +
>>> +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard
>>> environment, filters and checks +. ./common/rc +. ./common/filter
>>> + +_supported_fs btrfs +_supported_os Linux +_require_scratch + +rm
>>> -f $seqres.full + +_quota_enabled_background() +{ + i=1 + while [
>>> $i -le 5 ] + do + _run_btrfs_util_prog quota enable $SCRATCH_MNT +
>>> _run_btrfs_util_prog quota disable $SCRATCH_MNT + i=$(($i+1)) +
>>> sleep 1 + done +} + +MKFS_SIZE=$((1024 * 1024 * 1024)) +run_check
>>> _scratch_mkfs_sized $MKFS_SIZE +run_check _scratch_mount +
>>> +_quota_enabled_background & +run_check $FSSTRESS_PROG -d
>>> $SCRATCH_MNT -w -p 5 -n 1000 \ + $FSSTRESS_AVOID + +run_check
>>> _scratch_unmount +_check_scratch_fs +
>>
>> You should probably be doing something to make sure the background
>> quota stuff exits properly before your script exits, my fio box can
>> run the fsstress in way less than 5 seconds. Thanks,
>
> josef - you might want to have a look at what your mailer is doing
> to quoted email ad fix it... ;)
Eesh I think it's enigmail, I'll turn it off. Thanks,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-03-10 3:44 [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Wang Shilong
2014-03-10 3:44 ` [PATCH v2 2/3] xfstests/btrfs: add basic functional test for btrfs quota groups Wang Shilong
2014-03-10 3:44 ` [PATCH v2 3/3] xfstests/btrfs: add stress test for btrfs quota operations Wang Shilong
@ 2014-03-10 19:43 ` Josef Bacik
2014-03-11 1:19 ` Wang Shilong
2014-05-07 20:58 ` Josef Bacik
2014-05-09 6:02 ` [PATCH v3] " Wang Shilong
4 siblings, 1 reply; 21+ messages in thread
From: Josef Bacik @ 2014-03-10 19:43 UTC (permalink / raw)
To: Wang Shilong, xfs; +Cc: linux-btrfs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/09/2014 11:44 PM, Wang Shilong wrote:
> Test flow is to run fsstress after triggering quota rescan. the
> ruler is simple, we just remove all files and directories, sync
> filesystem and see if qgroup's ref and excl are nodesize.
>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> ---
> v1->v2: switch into new helper _run_btrfs_util_prog() ---
> tests/btrfs/041 | 76
> +++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/btrfs/041.out | 3 +++ tests/btrfs/group | 1 + 3 files
> changed, 80 insertions(+) create mode 100644 tests/btrfs/041 create
> mode 100644 tests/btrfs/041.out
>
So this doesn't pass for me but it's not because we're broken, it's
because the test is broken. What you should do is run sync after you
do the rm, and then capture the output of btrfs qgroup show, and then
do the rescan and redo qgroup show and make sure the numbers match. I
did this in my qgroup test, you can look there as an example. Thanks,
Josef
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTHhXkAAoJEANb+wAKly3BQI8QAIEFXMPrFEJxj9uKuwnBZSSC
r4g7pHyac82EJA3T/jx+KIzH3aeUz0r1mEg8sYXXACAW5BZguyhe1LR0rU2ZBDaP
9ilgWwCVm3d3EhiDmZJDCZueB7IXqE4/GX6D1zyF9OxVNk3Ng9gOY0/3G7Rb52FI
UTT/UhA8f3mFHQq4DbOebfacu8wbMH9rjHucxgin63UQLx9J9k+3lv5Y7AHihSrX
3ly+B9+wqu9zl8gQGhxyvdayWeka6Hr43lkniaOehuW118WjjwIivE/CbTkla/3f
P3hoJSbUiqlCPONKkfGExYsIny0y9I3igMnLqs58RLeyd4+iSF1O4wFyFGn6hnDy
sazS8mz4V3PqnfHAj0D3scSYVyYvcrHcUU5WGs+0JiyExfQPFSrbybfwncIgbBg6
+63iqd7qHwwjClSVNckFurU4B+lj1aVyyk/S1/Z2jN/9s3nrM3/WAR3cqJGIuNyT
RPT9mzmkc1OICO0+dvwHMol894CCVh9b0iQ6e2NBWYmEfv3BIj9tZNjUZ/ySJdQC
h2f00uLovRPazI/X/gKVraHj13Go3giL5LCIbnUso/B18iA2V3qyyXGPMBTB1Rws
wzaxlXsC8cZsMUgFkg7z6Q1Kc9hyUj4AF3Vg/qZze4F216LLAOa9Bni5CxKOVytk
MPlXItpXYAEX8orapQdO
=/ZGH
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-03-10 19:43 ` [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Josef Bacik
@ 2014-03-11 1:19 ` Wang Shilong
0 siblings, 0 replies; 21+ messages in thread
From: Wang Shilong @ 2014-03-11 1:19 UTC (permalink / raw)
To: Josef Bacik; +Cc: xfs, linux-btrfs
On 03/11/2014 03:43 AM, Josef Bacik wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>> Test flow is to run fsstress after triggering quota rescan. the
>> ruler is simple, we just remove all files and directories, sync
>> filesystem and see if qgroup's ref and excl are nodesize.
>>
>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> ---
>> v1->v2: switch into new helper _run_btrfs_util_prog() ---
>> tests/btrfs/041 | 76
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> tests/btrfs/041.out | 3 +++ tests/btrfs/group | 1 + 3 files
>> changed, 80 insertions(+) create mode 100644 tests/btrfs/041 create
>> mode 100644 tests/btrfs/041.out
>>
> So this doesn't pass for me but it's not because we're broken, it's
> because the test is broken. What you should do is run sync after you
> do the rm, and then capture the output of btrfs qgroup show, and then
> do the rescan and redo qgroup show and make sure the numbers match. I
> did this in my qgroup test, you can look there as an example. Thanks,
Let's take a look at my test flows:
step1: write some random data to fs tree and then create a snapshot of
fs tree.
step2: also try to write some random data to newly created snapshot.
step3: enable quota and wait quota rescan finished.(btrfs quota rescan -w)
step4: remove all files and sync btrfs filesystem.
So i did a simple test that if we don't create snapshot here, i get
qgroup accounting
right here, so i think it is realted to qgroup accounting that differs
'refer' and 'excl'.
Thanks,
Wang
>
> Josef
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJTHhXkAAoJEANb+wAKly3BQI8QAIEFXMPrFEJxj9uKuwnBZSSC
> r4g7pHyac82EJA3T/jx+KIzH3aeUz0r1mEg8sYXXACAW5BZguyhe1LR0rU2ZBDaP
> 9ilgWwCVm3d3EhiDmZJDCZueB7IXqE4/GX6D1zyF9OxVNk3Ng9gOY0/3G7Rb52FI
> UTT/UhA8f3mFHQq4DbOebfacu8wbMH9rjHucxgin63UQLx9J9k+3lv5Y7AHihSrX
> 3ly+B9+wqu9zl8gQGhxyvdayWeka6Hr43lkniaOehuW118WjjwIivE/CbTkla/3f
> P3hoJSbUiqlCPONKkfGExYsIny0y9I3igMnLqs58RLeyd4+iSF1O4wFyFGn6hnDy
> sazS8mz4V3PqnfHAj0D3scSYVyYvcrHcUU5WGs+0JiyExfQPFSrbybfwncIgbBg6
> +63iqd7qHwwjClSVNckFurU4B+lj1aVyyk/S1/Z2jN/9s3nrM3/WAR3cqJGIuNyT
> RPT9mzmkc1OICO0+dvwHMol894CCVh9b0iQ6e2NBWYmEfv3BIj9tZNjUZ/ySJdQC
> h2f00uLovRPazI/X/gKVraHj13Go3giL5LCIbnUso/B18iA2V3qyyXGPMBTB1Rws
> wzaxlXsC8cZsMUgFkg7z6Q1Kc9hyUj4AF3Vg/qZze4F216LLAOa9Bni5CxKOVytk
> MPlXItpXYAEX8orapQdO
> =/ZGH
> -----END PGP SIGNATURE-----
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-03-10 3:44 [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Wang Shilong
` (2 preceding siblings ...)
2014-03-10 19:43 ` [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Josef Bacik
@ 2014-05-07 20:58 ` Josef Bacik
2014-05-08 3:38 ` Wang Shilong
2014-05-09 6:02 ` [PATCH v3] " Wang Shilong
4 siblings, 1 reply; 21+ messages in thread
From: Josef Bacik @ 2014-05-07 20:58 UTC (permalink / raw)
To: Wang Shilong, xfs; +Cc: linux-btrfs
On 03/09/2014 11:44 PM, Wang Shilong wrote:
> Test flow is to run fsstress after triggering quota rescan.
> the ruler is simple, we just remove all files and directories,
> sync filesystem and see if qgroup's ref and excl are nodesize.
>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> ---
> v1->v2:
> switch into new helper _run_btrfs_util_prog()
> ---
> tests/btrfs/041 | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/btrfs/041.out | 3 +++
> tests/btrfs/group | 1 +
> 3 files changed, 80 insertions(+)
> create mode 100644 tests/btrfs/041
> create mode 100644 tests/btrfs/041.out
>
> diff --git a/tests/btrfs/041 b/tests/btrfs/041
> new file mode 100644
> index 0000000..92bd080
> --- /dev/null
> +++ b/tests/btrfs/041
> @@ -0,0 +1,76 @@
> +#! /bin/bash
> +# FSQA Test No. btrfs/041
> +#
> +# Quota rescan stress test, we run fsstress and quota rescan concurrently
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (C) 2014 Fujitsu. All rights reserved.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> +#
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1
> +
> +_cleanup()
> +{
> + cd /
> + rm -f $tmp.*
> +}
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_need_to_be_root
> +_supported_fs btrfs
> +_supported_os Linux
> +_require_scratch
> +
> +rm -f $seqres.full
> +
> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
> +run_check _scratch_mount
> +
Add "-o nospace_cache" here please, otherwise I don't get the same output.
> +# -w ensures that the only ops are ones which cause write I/O
> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
> + $FSSTRESS_AVOID >&/dev/null
> +
> +_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
> + $SCRATCH_MNT/snap1 >>$seqres.full 2>&1
_run_btrfs_util_prog will already redirect to $seqres.full, you don't
need this part.
> +
> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
> + $FSSTRESS_AVOID >&/dev/null
> +
> +_run_btrfs_util_prog quota enable $SCRATCH_MNT
> +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
> +
> +#ignore removing subvolume errors
> +rm -rf $SCRATCH_MNT/* >& /dev/null
> +
> +_run_btrfs_util_prog filesystem sync $SCRATCH_MNT >> $seqres.full 2>&1
Same here.
> +_run_btrfs_util_prog qgroup show $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' \
> + | $AWK_PROG '{print $1" "$2" "$3 }'
> +
You can't use _run_btrfs_util_prog here, it will eat the output. You
need to use $BTRFS_UTIL_PROG instead. Fix these up and resend, this is
a really important test and I needed it to make sure my qgroups patch
was right (which it is now.) Thanks,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-05-07 20:58 ` Josef Bacik
@ 2014-05-08 3:38 ` Wang Shilong
2014-05-08 18:33 ` Josef Bacik
0 siblings, 1 reply; 21+ messages in thread
From: Wang Shilong @ 2014-05-08 3:38 UTC (permalink / raw)
To: Josef Bacik; +Cc: xfs, linux-btrfs
On 05/08/2014 04:58 AM, Josef Bacik wrote:
> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>> Test flow is to run fsstress after triggering quota rescan.
>> the ruler is simple, we just remove all files and directories,
>> sync filesystem and see if qgroup's ref and excl are nodesize.
>>
>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>> ---
>> v1->v2:
>> switch into new helper _run_btrfs_util_prog()
>> ---
>> tests/btrfs/041 | 76
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> tests/btrfs/041.out | 3 +++
>> tests/btrfs/group | 1 +
>> 3 files changed, 80 insertions(+)
>> create mode 100644 tests/btrfs/041
>> create mode 100644 tests/btrfs/041.out
>>
>> diff --git a/tests/btrfs/041 b/tests/btrfs/041
>> new file mode 100644
>> index 0000000..92bd080
>> --- /dev/null
>> +++ b/tests/btrfs/041
>> @@ -0,0 +1,76 @@
>> +#! /bin/bash
>> +# FSQA Test No. btrfs/041
>> +#
>> +# Quota rescan stress test, we run fsstress and quota rescan
>> concurrently
>> +#
>> +#-----------------------------------------------------------------------
>>
>> +# Copyright (C) 2014 Fujitsu. All rights reserved.
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation.
>> +#
>> +# This program is distributed in the hope that it would be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write the Free Software Foundation,
>> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>> +#
>> +#-----------------------------------------------------------------------
>>
>> +#
>> +
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmp=/tmp/$$
>> +status=1
>> +
>> +_cleanup()
>> +{
>> + cd /
>> + rm -f $tmp.*
>> +}
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +# get standard environment, filters and checks
>> +. ./common/rc
>> +. ./common/filter
>> +
>> +# real QA test starts here
>> +_need_to_be_root
>> +_supported_fs btrfs
>> +_supported_os Linux
>> +_require_scratch
>> +
>> +rm -f $seqres.full
>> +
>> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
>> +run_check _scratch_mount
>> +
>
> Add "-o nospace_cache" here please, otherwise I don't get the same
> output.
I am little confused why we need specify this mount option explicitly?
As far as i know, space cache is not included into qgroup accounting space.
Thanks,
Wang
>
>> +# -w ensures that the only ops are ones which cause write I/O
>> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
>> + $FSSTRESS_AVOID >&/dev/null
>> +
>> +_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
>> + $SCRATCH_MNT/snap1 >>$seqres.full 2>&1
>
> _run_btrfs_util_prog will already redirect to $seqres.full, you don't
> need this part.
>
>> +
>> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
>> + $FSSTRESS_AVOID >&/dev/null
>> +
>> +_run_btrfs_util_prog quota enable $SCRATCH_MNT
>> +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
>> +
>> +#ignore removing subvolume errors
>> +rm -rf $SCRATCH_MNT/* >& /dev/null
>> +
>> +_run_btrfs_util_prog filesystem sync $SCRATCH_MNT >> $seqres.full 2>&1
>
> Same here.
>
>> +_run_btrfs_util_prog qgroup show $SCRATCH_MNT | $SED_PROG -n
>> '/[0-9]/p' \
>> + | $AWK_PROG '{print $1" "$2" "$3 }'
>> +
>
> You can't use _run_btrfs_util_prog here, it will eat the output. You
> need to use $BTRFS_UTIL_PROG instead. Fix these up and resend, this
> is a really important test and I needed it to make sure my qgroups
> patch was right (which it is now.) Thanks,
>
> Josef
> .
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-05-08 3:38 ` Wang Shilong
@ 2014-05-08 18:33 ` Josef Bacik
2014-05-09 1:17 ` Wang Shilong
0 siblings, 1 reply; 21+ messages in thread
From: Josef Bacik @ 2014-05-08 18:33 UTC (permalink / raw)
To: Wang Shilong; +Cc: xfs, linux-btrfs
On 05/07/2014 11:38 PM, Wang Shilong wrote:
> On 05/08/2014 04:58 AM, Josef Bacik wrote:
>> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>>> Test flow is to run fsstress after triggering quota rescan.
>>> the ruler is simple, we just remove all files and directories,
>>> sync filesystem and see if qgroup's ref and excl are nodesize.
>>>
>>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>>> ---
>>> v1->v2:
>>> switch into new helper _run_btrfs_util_prog()
>>> ---
>>> tests/btrfs/041 | 76
>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> tests/btrfs/041.out | 3 +++
>>> tests/btrfs/group | 1 +
>>> 3 files changed, 80 insertions(+)
>>> create mode 100644 tests/btrfs/041
>>> create mode 100644 tests/btrfs/041.out
>>>
>>> diff --git a/tests/btrfs/041 b/tests/btrfs/041
>>> new file mode 100644
>>> index 0000000..92bd080
>>> --- /dev/null
>>> +++ b/tests/btrfs/041
>>> @@ -0,0 +1,76 @@
>>> +#! /bin/bash
>>> +# FSQA Test No. btrfs/041
>>> +#
>>> +# Quota rescan stress test, we run fsstress and quota rescan
>>> concurrently
>>> +#
>>> +#-----------------------------------------------------------------------
>>>
>>> +# Copyright (C) 2014 Fujitsu. All rights reserved.
>>> +#
>>> +# This program is free software; you can redistribute it and/or
>>> +# modify it under the terms of the GNU General Public License as
>>> +# published by the Free Software Foundation.
>>> +#
>>> +# This program is distributed in the hope that it would be useful,
>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>> +# GNU General Public License for more details.
>>> +#
>>> +# You should have received a copy of the GNU General Public License
>>> +# along with this program; if not, write the Free Software Foundation,
>>> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>>> +#
>>> +#-----------------------------------------------------------------------
>>>
>>> +#
>>> +
>>> +seq=`basename $0`
>>> +seqres=$RESULT_DIR/$seq
>>> +echo "QA output created by $seq"
>>> +
>>> +here=`pwd`
>>> +tmp=/tmp/$$
>>> +status=1
>>> +
>>> +_cleanup()
>>> +{
>>> + cd /
>>> + rm -f $tmp.*
>>> +}
>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>> +
>>> +# get standard environment, filters and checks
>>> +. ./common/rc
>>> +. ./common/filter
>>> +
>>> +# real QA test starts here
>>> +_need_to_be_root
>>> +_supported_fs btrfs
>>> +_supported_os Linux
>>> +_require_scratch
>>> +
>>> +rm -f $seqres.full
>>> +
>>> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
>>> +run_check _scratch_mount
>>> +
>>
>> Add "-o nospace_cache" here please, otherwise I don't get the same
>> output.
>
> I am little confused why we need specify this mount option explicitly?
> As far as i know, space cache is not included into qgroup accounting space.
>
It is. Thanks,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-05-08 18:33 ` Josef Bacik
@ 2014-05-09 1:17 ` Wang Shilong
2014-05-09 2:13 ` Josef Bacik
0 siblings, 1 reply; 21+ messages in thread
From: Wang Shilong @ 2014-05-09 1:17 UTC (permalink / raw)
To: Josef Bacik; +Cc: xfs, linux-btrfs
On 05/09/2014 02:33 AM, Josef Bacik wrote:
> On 05/07/2014 11:38 PM, Wang Shilong wrote:
>> On 05/08/2014 04:58 AM, Josef Bacik wrote:
>>> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>>>> Test flow is to run fsstress after triggering quota rescan.
>>>> the ruler is simple, we just remove all files and directories,
>>>> sync filesystem and see if qgroup's ref and excl are nodesize.
>>>>
>>>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>>>> ---
>>>> v1->v2:
>>>> switch into new helper _run_btrfs_util_prog()
>>>> ---
>>>> tests/btrfs/041 | 76
>>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>> tests/btrfs/041.out | 3 +++
>>>> tests/btrfs/group | 1 +
>>>> 3 files changed, 80 insertions(+)
>>>> create mode 100644 tests/btrfs/041
>>>> create mode 100644 tests/btrfs/041.out
>>>>
>>>> diff --git a/tests/btrfs/041 b/tests/btrfs/041
>>>> new file mode 100644
>>>> index 0000000..92bd080
>>>> --- /dev/null
>>>> +++ b/tests/btrfs/041
>>>> @@ -0,0 +1,76 @@
>>>> +#! /bin/bash
>>>> +# FSQA Test No. btrfs/041
>>>> +#
>>>> +# Quota rescan stress test, we run fsstress and quota rescan
>>>> concurrently
>>>> +#
>>>> +#-----------------------------------------------------------------------
>>>>
>>>>
>>>> +# Copyright (C) 2014 Fujitsu. All rights reserved.
>>>> +#
>>>> +# This program is free software; you can redistribute it and/or
>>>> +# modify it under the terms of the GNU General Public License as
>>>> +# published by the Free Software Foundation.
>>>> +#
>>>> +# This program is distributed in the hope that it would be useful,
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>>> +# GNU General Public License for more details.
>>>> +#
>>>> +# You should have received a copy of the GNU General Public License
>>>> +# along with this program; if not, write the Free Software
>>>> Foundation,
>>>> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>>>> +#
>>>> +#-----------------------------------------------------------------------
>>>>
>>>>
>>>> +#
>>>> +
>>>> +seq=`basename $0`
>>>> +seqres=$RESULT_DIR/$seq
>>>> +echo "QA output created by $seq"
>>>> +
>>>> +here=`pwd`
>>>> +tmp=/tmp/$$
>>>> +status=1
>>>> +
>>>> +_cleanup()
>>>> +{
>>>> + cd /
>>>> + rm -f $tmp.*
>>>> +}
>>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>>> +
>>>> +# get standard environment, filters and checks
>>>> +. ./common/rc
>>>> +. ./common/filter
>>>> +
>>>> +# real QA test starts here
>>>> +_need_to_be_root
>>>> +_supported_fs btrfs
>>>> +_supported_os Linux
>>>> +_require_scratch
>>>> +
>>>> +rm -f $seqres.full
>>>> +
>>>> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
>>>> +run_check _scratch_mount
>>>> +
>>>
>>> Add "-o nospace_cache" here please, otherwise I don't get the same
>>> output.
>>
>> I am little confused why we need specify this mount option explicitly?
>> As far as i know, space cache is not included into qgroup accounting
>> space.
>>
>
> It is. Thanks,
Free space cache are inserted in tree root, they can not be shared with
other trees(fs/file tree).
So normal fs/file tree's qgroup accounting is independeng of free space
cache.
With or without the option, subvolume qgroup's value should not have any
differences.
Did i miss something here?:-)
Thanks,
Wang
>
> Josef
>
> .
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-05-09 1:17 ` Wang Shilong
@ 2014-05-09 2:13 ` Josef Bacik
2014-05-09 2:43 ` Wang Shilong
0 siblings, 1 reply; 21+ messages in thread
From: Josef Bacik @ 2014-05-09 2:13 UTC (permalink / raw)
To: Wang Shilong; +Cc: xfs@oss.sgi.com, linux-btrfs@vger.kernel.org
The inode cache is saved in the FS tree itself for every individual FS tree, that affects the sizes reported by qgroup show so we need to explicitly turn it off to get consistent values. Thanks,
Josef
Wang Shilong <wangsl.fnst@cn.fujitsu.com> wrote:
On 05/09/2014 02:33 AM, Josef Bacik wrote:
> On 05/07/2014 11:38 PM, Wang Shilong wrote:
>> On 05/08/2014 04:58 AM, Josef Bacik wrote:
>>> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>>>> Test flow is to run fsstress after triggering quota rescan.
>>>> the ruler is simple, we just remove all files and directories,
>>>> sync filesystem and see if qgroup's ref and excl are nodesize.
>>>>
>>>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>>>> ---
>>>> v1->v2:
>>>> switch into new helper _run_btrfs_util_prog()
>>>> ---
>>>> tests/btrfs/041 | 76
>>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>> tests/btrfs/041.out | 3 +++
>>>> tests/btrfs/group | 1 +
>>>> 3 files changed, 80 insertions(+)
>>>> create mode 100644 tests/btrfs/041
>>>> create mode 100644 tests/btrfs/041.out
>>>>
>>>> diff --git a/tests/btrfs/041 b/tests/btrfs/041
>>>> new file mode 100644
>>>> index 0000000..92bd080
>>>> --- /dev/null
>>>> +++ b/tests/btrfs/041
>>>> @@ -0,0 +1,76 @@
>>>> +#! /bin/bash
>>>> +# FSQA Test No. btrfs/041
>>>> +#
>>>> +# Quota rescan stress test, we run fsstress and quota rescan
>>>> concurrently
>>>> +#
>>>> +#-----------------------------------------------------------------------
>>>>
>>>>
>>>> +# Copyright (C) 2014 Fujitsu. All rights reserved.
>>>> +#
>>>> +# This program is free software; you can redistribute it and/or
>>>> +# modify it under the terms of the GNU General Public License as
>>>> +# published by the Free Software Foundation.
>>>> +#
>>>> +# This program is distributed in the hope that it would be useful,
>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>>> +# GNU General Public License for more details.
>>>> +#
>>>> +# You should have received a copy of the GNU General Public License
>>>> +# along with this program; if not, write the Free Software
>>>> Foundation,
>>>> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>>>> +#
>>>> +#-----------------------------------------------------------------------
>>>>
>>>>
>>>> +#
>>>> +
>>>> +seq=`basename $0`
>>>> +seqres=$RESULT_DIR/$seq
>>>> +echo "QA output created by $seq"
>>>> +
>>>> +here=`pwd`
>>>> +tmp=/tmp/$$
>>>> +status=1
>>>> +
>>>> +_cleanup()
>>>> +{
>>>> + cd /
>>>> + rm -f $tmp.*
>>>> +}
>>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>>> +
>>>> +# get standard environment, filters and checks
>>>> +. ./common/rc
>>>> +. ./common/filter
>>>> +
>>>> +# real QA test starts here
>>>> +_need_to_be_root
>>>> +_supported_fs btrfs
>>>> +_supported_os Linux
>>>> +_require_scratch
>>>> +
>>>> +rm -f $seqres.full
>>>> +
>>>> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
>>>> +run_check _scratch_mount
>>>> +
>>>
>>> Add "-o nospace_cache" here please, otherwise I don't get the same
>>> output.
>>
>> I am little confused why we need specify this mount option explicitly?
>> As far as i know, space cache is not included into qgroup accounting
>> space.
>>
>
> It is. Thanks,
Free space cache are inserted in tree root, they can not be shared with
other trees(fs/file tree).
So normal fs/file tree's qgroup accounting is independeng of free space
cache.
With or without the option, subvolume qgroup's value should not have any
differences.
Did i miss something here?:-)
Thanks,
Wang
>
> Josef
>
> .
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at https://urldefense.proofpoint.com/v1/url?u=http://vger.kernel.org/majordomo-info.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=G4HqImi%2Fy7KWWbAvCZf%2Bl8CSV3XzU9ODKrgtdQCTPYQ%3D%0A&s=e27422f119365ab04dddfb06e08c152eec84c4de29e19b6811310607e6a15c99
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-05-09 2:13 ` Josef Bacik
@ 2014-05-09 2:43 ` Wang Shilong
2014-05-09 17:24 ` Josef Bacik
0 siblings, 1 reply; 21+ messages in thread
From: Wang Shilong @ 2014-05-09 2:43 UTC (permalink / raw)
To: Josef Bacik; +Cc: xfs@oss.sgi.com, linux-btrfs@vger.kernel.org
On 05/09/2014 10:13 AM, Josef Bacik wrote:
> The inode cache is saved in the FS tree itself for every individual FS tree, that affects the sizes reported by qgroup show so we need to explicitly turn it off to get consistent values. Thanks,
Right, so we need turn off inode_cache explicitly rather than free_space
option.
I will fix all your addressed comments and resend the patch.
Thanks,
Wang
> Josef
>
> Wang Shilong<wangsl.fnst@cn.fujitsu.com> wrote:
>
>
> On 05/09/2014 02:33 AM, Josef Bacik wrote:
>> On 05/07/2014 11:38 PM, Wang Shilong wrote:
>>> On 05/08/2014 04:58 AM, Josef Bacik wrote:
>>>> On 03/09/2014 11:44 PM, Wang Shilong wrote:
>>>>> Test flow is to run fsstress after triggering quota rescan.
>>>>> the ruler is simple, we just remove all files and directories,
>>>>> sync filesystem and see if qgroup's ref and excl are nodesize.
>>>>>
>>>>> Signed-off-by: Wang Shilong<wangsl.fnst@cn.fujitsu.com>
>>>>> ---
>>>>> v1->v2:
>>>>> switch into new helper _run_btrfs_util_prog()
>>>>> ---
>>>>> tests/btrfs/041 | 76
>>>>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>> tests/btrfs/041.out | 3 +++
>>>>> tests/btrfs/group | 1 +
>>>>> 3 files changed, 80 insertions(+)
>>>>> create mode 100644 tests/btrfs/041
>>>>> create mode 100644 tests/btrfs/041.out
>>>>>
>>>>> diff --git a/tests/btrfs/041 b/tests/btrfs/041
>>>>> new file mode 100644
>>>>> index 0000000..92bd080
>>>>> --- /dev/null
>>>>> +++ b/tests/btrfs/041
>>>>> @@ -0,0 +1,76 @@
>>>>> +#! /bin/bash
>>>>> +# FSQA Test No. btrfs/041
>>>>> +#
>>>>> +# Quota rescan stress test, we run fsstress and quota rescan
>>>>> concurrently
>>>>> +#
>>>>> +#-----------------------------------------------------------------------
>>>>>
>>>>>
>>>>> +# Copyright (C) 2014 Fujitsu. All rights reserved.
>>>>> +#
>>>>> +# This program is free software; you can redistribute it and/or
>>>>> +# modify it under the terms of the GNU General Public License as
>>>>> +# published by the Free Software Foundation.
>>>>> +#
>>>>> +# This program is distributed in the hope that it would be useful,
>>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>>>> +# GNU General Public License for more details.
>>>>> +#
>>>>> +# You should have received a copy of the GNU General Public License
>>>>> +# along with this program; if not, write the Free Software
>>>>> Foundation,
>>>>> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>>>>> +#
>>>>> +#-----------------------------------------------------------------------
>>>>>
>>>>>
>>>>> +#
>>>>> +
>>>>> +seq=`basename $0`
>>>>> +seqres=$RESULT_DIR/$seq
>>>>> +echo "QA output created by $seq"
>>>>> +
>>>>> +here=`pwd`
>>>>> +tmp=/tmp/$$
>>>>> +status=1
>>>>> +
>>>>> +_cleanup()
>>>>> +{
>>>>> + cd /
>>>>> + rm -f $tmp.*
>>>>> +}
>>>>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>>>>> +
>>>>> +# get standard environment, filters and checks
>>>>> +. ./common/rc
>>>>> +. ./common/filter
>>>>> +
>>>>> +# real QA test starts here
>>>>> +_need_to_be_root
>>>>> +_supported_fs btrfs
>>>>> +_supported_os Linux
>>>>> +_require_scratch
>>>>> +
>>>>> +rm -f $seqres.full
>>>>> +
>>>>> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
>>>>> +run_check _scratch_mount
>>>>> +
>>>> Add "-o nospace_cache" here please, otherwise I don't get the same
>>>> output.
>>> I am little confused why we need specify this mount option explicitly?
>>> As far as i know, space cache is not included into qgroup accounting
>>> space.
>>>
>> It is. Thanks,
> Free space cache are inserted in tree root, they can not be shared with
> other trees(fs/file tree).
> So normal fs/file tree's qgroup accounting is independeng of free space
> cache.
>
> With or without the option, subvolume qgroup's value should not have any
> differences.
> Did i miss something here?:-)
>
> Thanks,
> Wang
>> Josef
>>
>> .
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message tomajordomo@vger.kernel.org
> More majordomo info athttps://urldefense.proofpoint.com/v1/url?u=http://vger.kernel.org/majordomo-info.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=cKCbChRKsMpTX8ybrSkonQ%3D%3D%0A&m=G4HqImi%2Fy7KWWbAvCZf%2Bl8CSV3XzU9ODKrgtdQCTPYQ%3D%0A&s=e27422f119365ab04dddfb06e08c152eec84c4de29e19b6811310607e6a15c99
> .
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test
2014-05-09 2:43 ` Wang Shilong
@ 2014-05-09 17:24 ` Josef Bacik
0 siblings, 0 replies; 21+ messages in thread
From: Josef Bacik @ 2014-05-09 17:24 UTC (permalink / raw)
To: Wang Shilong; +Cc: xfs@oss.sgi.com, linux-btrfs@vger.kernel.org
On 05/08/2014 10:43 PM, Wang Shilong wrote:
> On 05/09/2014 10:13 AM, Josef Bacik wrote:
>> The inode cache is saved in the FS tree itself for every individual FS
>> tree, that affects the sizes reported by qgroup show so we need to
>> explicitly turn it off to get consistent values. Thanks,
> Right, so we need turn off inode_cache explicitly rather than free_space
> option.
> I will fix all your addressed comments and resend the patch.
>
Sigh I totally said nospace_cache didn't I? I really meant
noinode_cache, sorry,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v3] xfstests/btrfs: add qgroup rescan stress test
2014-03-10 3:44 [PATCH v2 1/3] xfstests/btrfs: add qgroup rescan stress test Wang Shilong
` (3 preceding siblings ...)
2014-05-07 20:58 ` Josef Bacik
@ 2014-05-09 6:02 ` Wang Shilong
2014-05-09 17:32 ` Josef Bacik
2014-06-18 8:36 ` Wang Shilong
4 siblings, 2 replies; 21+ messages in thread
From: Wang Shilong @ 2014-05-09 6:02 UTC (permalink / raw)
To: xfs; +Cc: linux-btrfs, jbacik
Test flow is to run fsstress after triggering quota rescan.
the ruler is simple, we just remove all files and directories,
sync filesystem and see if qgroup's ref and excl are nodesize.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
v2->v3: addressed comments from josef:
- remove unnecessary redirections
- don't use _run_btrfs_util_prog() when capturing qgroup show output.
- turn off inode_cache mount option explicitly.
v1->v2: switch to _run_btrfs_util_prog()
---
tests/btrfs/050 | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/btrfs/050.out | 3 ++
tests/btrfs/group | 1 +
3 files changed, 85 insertions(+)
create mode 100644 tests/btrfs/050
create mode 100644 tests/btrfs/050.out
diff --git a/tests/btrfs/050 b/tests/btrfs/050
new file mode 100644
index 0000000..81d953a
--- /dev/null
+++ b/tests/btrfs/050
@@ -0,0 +1,81 @@
+#! /bin/bash
+# FSQA Test No. btrfs/050
+#
+# Quota rescan stress test, we run fsstress and quota rescan concurrently
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2014 Fujitsu. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+
+# use small leaf size to get higher btree height.
+run_check _scratch_mkfs "-b 1g --nodesize 4096"
+
+# inode cache is saved in the FS tree itself for every
+# individual FS tree,that affects the sizes reported by qgroup show
+# so we need to explicitly turn it off to get consistent values.
+run_check _scratch_mount "-o noinode_cache"
+
+# -w ensures that the only ops are ones which cause write I/O
+run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
+ $FSSTRESS_AVOID >&/dev/null
+
+_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
+ $SCRATCH_MNT/snap1
+
+run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
+ $FSSTRESS_AVOID >&/dev/null
+
+_run_btrfs_util_prog quota enable $SCRATCH_MNT
+_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
+
+# ignore removing subvolume errors
+rm -rf $SCRATCH_MNT/* >& /dev/null
+
+_run_btrfs_util_prog filesystem sync $SCRATCH_MNT
+$BTRFS_UTIL_PROG qgroup show $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' \
+ | $AWK_PROG '{print $2" "$3}'
+
+status=0
+exit
diff --git a/tests/btrfs/050.out b/tests/btrfs/050.out
new file mode 100644
index 0000000..a388160
--- /dev/null
+++ b/tests/btrfs/050.out
@@ -0,0 +1,3 @@
+QA output created by 050
+4096 4096
+4096 4096
diff --git a/tests/btrfs/group b/tests/btrfs/group
index 59b0c98..ee3e8a5 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -52,3 +52,4 @@
047 auto quick
048 auto quick
049 auto quick
+050 auto quick
--
1.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v3] xfstests/btrfs: add qgroup rescan stress test
2014-05-09 6:02 ` [PATCH v3] " Wang Shilong
@ 2014-05-09 17:32 ` Josef Bacik
2014-06-18 8:36 ` Wang Shilong
1 sibling, 0 replies; 21+ messages in thread
From: Josef Bacik @ 2014-05-09 17:32 UTC (permalink / raw)
To: Wang Shilong, xfs; +Cc: linux-btrfs
On 05/09/2014 02:02 AM, Wang Shilong wrote:
> Test flow is to run fsstress after triggering quota rescan.
> the ruler is simple, we just remove all files and directories,
> sync filesystem and see if qgroup's ref and excl are nodesize.
>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> ---
> v2->v3: addressed comments from josef:
> - remove unnecessary redirections
> - don't use _run_btrfs_util_prog() when capturing qgroup show output.
> - turn off inode_cache mount option explicitly.
>
> v1->v2: switch to _run_btrfs_util_prog()
Perfect thanks Wang,
Reviewed-by: Josef Bacik <jbacik@fb.com>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] xfstests/btrfs: add qgroup rescan stress test
2014-05-09 6:02 ` [PATCH v3] " Wang Shilong
2014-05-09 17:32 ` Josef Bacik
@ 2014-06-18 8:36 ` Wang Shilong
2014-06-18 15:24 ` Josef Bacik
2014-06-19 0:51 ` Dave Chinner
1 sibling, 2 replies; 21+ messages in thread
From: Wang Shilong @ 2014-06-18 8:36 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs
Hello Josef,
The lastest Qgroup code still break this test sometimes.
Ps: this test seems not merging into xfstests.
On 05/09/2014 02:02 PM, Wang Shilong wrote:
> Test flow is to run fsstress after triggering quota rescan.
> the ruler is simple, we just remove all files and directories,
> sync filesystem and see if qgroup's ref and excl are nodesize.
>
> Signed-off-by: Wang Shilong<wangsl.fnst@cn.fujitsu.com>
> ---
> v2->v3: addressed comments from josef:
> - remove unnecessary redirections
> - don't use _run_btrfs_util_prog() when capturing qgroup show output.
> - turn off inode_cache mount option explicitly.
>
> v1->v2: switch to _run_btrfs_util_prog()
> ---
> tests/btrfs/050 | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/btrfs/050.out | 3 ++
> tests/btrfs/group | 1 +
> 3 files changed, 85 insertions(+)
> create mode 100644 tests/btrfs/050
> create mode 100644 tests/btrfs/050.out
>
> diff --git a/tests/btrfs/050 b/tests/btrfs/050
> new file mode 100644
> index 0000000..81d953a
> --- /dev/null
> +++ b/tests/btrfs/050
> @@ -0,0 +1,81 @@
> +#! /bin/bash
> +# FSQA Test No. btrfs/050
> +#
> +# Quota rescan stress test, we run fsstress and quota rescan concurrently
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (C) 2014 Fujitsu. All rights reserved.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> +#
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1
> +
> +_cleanup()
> +{
> + cd /
> + rm -f $tmp.*
> +}
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_need_to_be_root
> +_supported_fs btrfs
> +_supported_os Linux
> +_require_scratch
> +
> +rm -f $seqres.full
> +
> +# use small leaf size to get higher btree height.
> +run_check _scratch_mkfs "-b 1g --nodesize 4096"
> +
> +# inode cache is saved in the FS tree itself for every
> +# individual FS tree,that affects the sizes reported by qgroup show
> +# so we need to explicitly turn it off to get consistent values.
> +run_check _scratch_mount "-o noinode_cache"
> +
> +# -w ensures that the only ops are ones which cause write I/O
> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
> + $FSSTRESS_AVOID >&/dev/null
> +
> +_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
> + $SCRATCH_MNT/snap1
> +
> +run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
> + $FSSTRESS_AVOID >&/dev/null
> +
> +_run_btrfs_util_prog quota enable $SCRATCH_MNT
> +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
> +
> +# ignore removing subvolume errors
> +rm -rf $SCRATCH_MNT/* >& /dev/null
> +
> +_run_btrfs_util_prog filesystem sync $SCRATCH_MNT
> +$BTRFS_UTIL_PROG qgroup show $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' \
> + | $AWK_PROG '{print $2" "$3}'
> +
> +status=0
> +exit
> diff --git a/tests/btrfs/050.out b/tests/btrfs/050.out
> new file mode 100644
> index 0000000..a388160
> --- /dev/null
> +++ b/tests/btrfs/050.out
> @@ -0,0 +1,3 @@
> +QA output created by 050
> +4096 4096
> +4096 4096
> diff --git a/tests/btrfs/group b/tests/btrfs/group
> index 59b0c98..ee3e8a5 100644
> --- a/tests/btrfs/group
> +++ b/tests/btrfs/group
> @@ -52,3 +52,4 @@
> 047 auto quick
> 048 auto quick
> 049 auto quick
> +050 auto quick
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] xfstests/btrfs: add qgroup rescan stress test
2014-06-18 8:36 ` Wang Shilong
@ 2014-06-18 15:24 ` Josef Bacik
2014-06-19 0:51 ` Dave Chinner
1 sibling, 0 replies; 21+ messages in thread
From: Josef Bacik @ 2014-06-18 15:24 UTC (permalink / raw)
To: Wang Shilong; +Cc: linux-btrfs
On 06/18/2014 01:36 AM, Wang Shilong wrote:
> Hello Josef,
>
> The lastest Qgroup code still break this test sometimes.
>
> Ps: this test seems not merging into xfstests.
>
Yeah Chris said something about this yesterday, I'll try and get a vm up
and running on my laptop soon and take a look at this. Just resend this
to the fstests list and make sure to include my reviewed-by, this test
is super important. Thanks,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] xfstests/btrfs: add qgroup rescan stress test
2014-06-18 8:36 ` Wang Shilong
2014-06-18 15:24 ` Josef Bacik
@ 2014-06-19 0:51 ` Dave Chinner
1 sibling, 0 replies; 21+ messages in thread
From: Dave Chinner @ 2014-06-19 0:51 UTC (permalink / raw)
To: Wang Shilong; +Cc: Josef Bacik, linux-btrfs
On Wed, Jun 18, 2014 at 04:36:22PM +0800, Wang Shilong wrote:
> Hello Josef,
>
> The lastest Qgroup code still break this test sometimes.
>
> Ps: this test seems not merging into xfstests.
Then repost it to fstests@vger.kernel.org. Sometimes patches get
missed...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 21+ messages in thread