* [PATCH 1/8] Fix test whether kernel supports quotas
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-05-24 14:14 ` [PATCH 2/8] Fix fallocate() test Jan Kara
` (6 subsequent siblings)
7 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
For all 2.6 kernels presence of quota support in kernel can be detected by
checking /proc/sys/fs/quota. This is actually more reliable than trying to
mount a filesystem with quota options (for example because SCRATCH_DEV does
not have to contain a filesystem type we are going to test).
Signed-off-by: Jan Kara <jack@suse.cz>
---
common.quota | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/common.quota b/common.quota
index 51bdc71..d32e285 100644
--- a/common.quota
+++ b/common.quota
@@ -27,10 +27,11 @@
_require_quota()
{
[ -x /usr/bin/quota ] || _notrun "Quota user tools not installed"
- _scratch_mount "-o usrquota,grpquota"
- ret=$?
- umount $SCRATCH_MNT
- [ $ret -ne 0 ] && _notrun "Installed kernel does not support quota"
+ if [ $FSTYP = "xfs" ]; then
+ [ -f /proc/fs/xfs/xqmstat ] || _notrun "Installed kernel does not support XFS quota"
+ elif [ $FSTYP != "gfs2" ]; then
+ [ -d /proc/sys/fs/quota ] || _notrun "Installed kernel does not support quota"
+ fi
}
#
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH 2/8] Fix fallocate() test
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
2010-05-24 14:14 ` [PATCH 1/8] Fix test whether kernel supports quotas Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-05-24 14:14 ` [PATCH 3/8] Test basic quota enforcement Jan Kara
` (5 subsequent siblings)
7 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
The test for fallocate was broken because it used $TEST_DIR/$tmp.io. Because
$tmp is usually something like /tmp/1234 or /mnt/1234 the file cannot be
created and xfs_io fails regardless of existance of fallocate support. Moreover
the subsequent message parsing decides that fallocate is actually supported
because it does not expect this message.
Fix the test to not use $tmp.
Signed-off-by: Jan Kara <jack@suse.cz>
---
common.rc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/common.rc b/common.rc
index e6d818d..6bf1e12 100644
--- a/common.rc
+++ b/common.rc
@@ -803,8 +803,9 @@ _require_user()
#
_require_xfs_io_falloc()
{
- testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $TEST_DIR/$tmp.io 2>&1`
- rm -f $TEST_DIR/$tmp.io 2>&1 > /dev/null
+ testfile=$TEST_DIR/$$.falloc
+ testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $testfile 2>&1`
+ rm -f $testfile 2>&1 > /dev/null
echo $testio | grep -q "not found" && \
_notrun "xfs_io fallocate support is missing"
echo $testio | grep -q "Operation not supported" && \
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH 3/8] Test basic quota enforcement
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
2010-05-24 14:14 ` [PATCH 1/8] Fix test whether kernel supports quotas Jan Kara
2010-05-24 14:14 ` [PATCH 2/8] Fix fallocate() test Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-05-25 10:06 ` Christoph Hellwig
2010-05-24 14:14 ` [PATCH 4/8] Add test of quota accounting using fsx Jan Kara
` (4 subsequent siblings)
7 siblings, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Add a test which checks whether basic quota enforcement works.
Signed-off-by: Jan Kara <jack@suse.cz>
---
230 | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
230.out | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
group | 1 +
3 files changed, 277 insertions(+), 0 deletions(-)
create mode 100755 230
create mode 100644 230.out
diff --git a/230 b/230
new file mode 100755
index 0000000..e75a828
--- /dev/null
+++ b/230
@@ -0,0 +1,145 @@
+#! /bin/bash
+# FS QA Test No. 230
+#
+# Simple quota enforcement test.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2010 Jan Kara. All Rights Reserved.
+#
+# Based on test 219,
+# Copyright (c) 2005 Silicon Graphics, Inc. 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
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux #IRIX
+_require_scratch
+_require_quota
+_require_user
+_need_to_be_root
+
+test_files()
+{
+ echo; echo "### create files, setting up ownership (type=$type)"
+ touch $SCRATCH_MNT/file{1,2} 2>/dev/null
+ chown $qa_user $SCRATCH_MNT/file{1,2} 2>/dev/null
+ chgrp $qa_user $SCRATCH_MNT/file{1,2} 2>/dev/null
+ chmod 777 $SCRATCH_MNT 2>/dev/null
+}
+
+test_enforcement()
+{
+ echo "### some buffered IO (type=$type)"
+ echo "--- initiating IO..." >>$seq.full
+ # Firstly fit below block soft limit
+ su $qa_user -c "$XFS_IO_PROG -F -c 'pwrite 0 4096' -c fsync \
+ $SCRATCH_MNT/file1" 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ # Secondly overcome block soft limit
+ su $qa_user -c "$XFS_IO_PROG -F -c 'pwrite 0 4097' -c fsync \
+ $SCRATCH_MNT/file1" 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ # Now try to overcome block hardlimit
+ su $qa_user -c "$XFS_IO_PROG -F -c 'pwrite 0 4097' -c fsync \
+ $SCRATCH_MNT/file2" 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ # Now sleep for grace time and check that softlimit got enforced
+ sleep $grace
+ su $qa_user -c "$XFS_IO_PROG -F -c 'truncate 0' -c 'pwrite 0 1' \
+ $SCRATCH_MNT/file2" 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ # And now the softlimit test for inodes
+ su $qa_user -c "touch $SCRATCH_MNT/file3" 2>&1 >>$seq.full |
+ filter_scratch | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ # Try to exceed inode hardlimit
+ su $qa_user -c "touch $SCRATCH_MNT/file4 $SCRATCH_MNT/file5" 2>&1 \
+ >>$seq.full | filter_scratch | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ # Wait and check grace time enforcement
+ rm -f $SCRATCH_MNT/file4 >>$seq.full 2>&1
+ sleep $grace
+ su $qa_user -c "touch $SCRATCH_MNT/file4" 2>&1 >>$seq.full |
+ filter_scratch | tee -a $seq.full
+ repquota -$type $SCRATCH_MNT | grep -v "^root" | filter_scratch
+ echo "--- completed IO ($type)" >>$seq.full
+}
+
+cleanup_files()
+{
+ rm -f $SCRATCH_MNT/file{1,2,3,4,5}
+}
+
+# real QA test starts here
+rm -f $seq.full
+
+grace=2
+
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon $SCRATCH_MNT 2>/dev/null
+setquota -u $qa_user 4 12 2 4 $SCRATCH_MNT
+setquota -u -t $grace $grace $SCRATCH_MNT
+setquota -g $qa_user 4 12 2 4 $SCRATCH_MNT
+setquota -g -t $grace $grace $SCRATCH_MNT
+umount $SCRATCH_DEV
+
+echo; echo "### test user limit enforcement"
+_scratch_mount "-o usrquota"
+quotaon $SCRATCH_MNT 2>/dev/null
+type=u
+test_files
+test_enforcement
+cleanup_files
+umount $SCRATCH_DEV 2>/dev/null
+
+echo; echo "### test group limit enforcement"
+_scratch_mount "-o grpquota"
+quotaon $SCRATCH_MNT 2>/dev/null
+type=g
+test_files
+test_enforcement
+cleanup_files
+umount $SCRATCH_DEV 2>/dev/null
+
+status=0
+exit
diff --git a/230.out b/230.out
new file mode 100644
index 0000000..e62d88f
--- /dev/null
+++ b/230.out
@@ -0,0 +1,131 @@
+QA output created by 230
+
+### test user limit enforcement
+
+### create files, setting up ownership (type=u)
+### some buffered IO (type=u)
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa -- 4 4 12 2 2 4
+
+
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa +- 8 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa +- 12 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa +- 8 4 12 none 2 2 4
+
+
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa ++ 8 4 12 none 3 2 4 00:00
+
+
+touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa ++ 8 4 12 none 4 2 4 00:00
+
+
+touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa ++ 8 4 12 none 3 2 4 none
+
+
+
+### test group limit enforcement
+
+### create files, setting up ownership (type=g)
+### some buffered IO (type=g)
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa -- 4 4 12 2 2 4
+
+
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa +- 8 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa +- 12 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa +- 8 4 12 none 2 2 4
+
+
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa ++ 8 4 12 none 3 2 4 00:00
+
+
+touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa ++ 8 4 12 none 4 2 4 00:00
+
+
+touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa ++ 8 4 12 none 3 2 4 none
+
+
diff --git a/group b/group
index 2c1ac50..441e0e9 100644
--- a/group
+++ b/group
@@ -343,3 +343,4 @@ deprecated
227 auto fsr
228 rw auto prealloc quick
229 auto rw
+230 auto quota quick
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 3/8] Test basic quota enforcement
2010-05-24 14:14 ` [PATCH 3/8] Test basic quota enforcement Jan Kara
@ 2010-05-25 10:06 ` Christoph Hellwig
2010-05-25 14:41 ` Jan Kara
2010-05-25 20:39 ` Jan Kara
0 siblings, 2 replies; 25+ messages in thread
From: Christoph Hellwig @ 2010-05-25 10:06 UTC (permalink / raw)
To: Jan Kara; +Cc: hch, xfs
On Mon, May 24, 2010 at 04:14:14PM +0200, Jan Kara wrote:
> Add a test which checks whether basic quota enforcement works.
This one fails for me when testing and xfs filesystem on latest Linus'
tree (with Debian -testing userspace):
--- 230.out 2010-05-25 09:49:35.000000000 +0000
+++ 230.out.bad 2010-05-25 09:52:49.000000000 +0000
@@ -4,20 +4,22 @@
### create files, setting up ownership (type=u)
### some buffered IO (type=u)
+pwrite64: Disk quota exceeded
*** Report for user quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa -- 4 4 12 2 2 4
+fsgqa -- 0 4 12 2 2 4 00:00
+pwrite64: Disk quota exceeded
*** Report for user quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa +- 8 4 12 00:00 2 2 4
+fsgqa -- 0 4 12 2 2 4 00:00
pwrite64: Disk quota exceeded
@@ -26,7 +28,7 @@
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa +- 12 4 12 00:00 2 2 4
+fsgqa -- 0 4 12 2 2 4 00:00
pwrite64: Disk quota exceeded
@@ -35,24 +37,26 @@
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa +- 8 4 12 none 2 2 4
+fsgqa -- 0 4 12 2 2 4 none
+touch: cannot touch `[SCR_MNT]/file3': Disk quota exceeded
*** Report for user quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa ++ 8 4 12 none 3 2 4 00:00
+fsgqa -- 0 4 12 2 2 4 none
+touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
*** Report for user quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa ++ 8 4 12 none 4 2 4 00:00
+fsgqa -- 0 4 12 2 2 4 none
touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
@@ -61,7 +65,7 @@
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa ++ 8 4 12 none 3 2 4 none
+fsgqa -- 0 4 12 2 2 4 none
@@ -69,20 +73,22 @@
### create files, setting up ownership (type=g)
### some buffered IO (type=g)
+pwrite64: Disk quota exceeded
*** Report for group quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa -- 4 4 12 2 2 4
+fsgqa -- 0 4 12 2 2 4 00:00
+pwrite64: Disk quota exceeded
*** Report for group quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa +- 8 4 12 00:00 2 2 4
+fsgqa -- 0 4 12 2 2 4 00:00
pwrite64: Disk quota exceeded
@@ -91,7 +97,7 @@
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa +- 12 4 12 00:00 2 2 4
+fsgqa -- 0 4 12 2 2 4 00:00
pwrite64: Disk quota exceeded
@@ -100,24 +106,26 @@
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa +- 8 4 12 none 2 2 4
+fsgqa -- 0 4 12 2 2 4 none
+touch: cannot touch `[SCR_MNT]/file3': Disk quota exceeded
*** Report for group quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa ++ 8 4 12 none 3 2 4 00:00
+fsgqa -- 0 4 12 2 2 4 none
+touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
*** Report for group quotas on device [SCR_DEV]
Block grace time: 00:00; Inode grace time: 00:00
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa ++ 8 4 12 none 4 2 4 00:00
+fsgqa -- 0 4 12 2 2 4 none
touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
@@ -126,6 +134,6 @@
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
-fsgqa ++ 8 4 12 none 3 2 4 none
+fsgqa -- 0 4 12 2 2 4 none
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 3/8] Test basic quota enforcement
2010-05-25 10:06 ` Christoph Hellwig
@ 2010-05-25 14:41 ` Jan Kara
2010-05-25 20:39 ` Jan Kara
1 sibling, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-25 14:41 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jan Kara, xfs
On Tue 25-05-10 06:06:35, Christoph Hellwig wrote:
> On Mon, May 24, 2010 at 04:14:14PM +0200, Jan Kara wrote:
> > Add a test which checks whether basic quota enforcement works.
>
> This one fails for me when testing and xfs filesystem on latest Linus'
> tree (with Debian -testing userspace):
>
> --- 230.out 2010-05-25 09:49:35.000000000 +0000
> +++ 230.out.bad 2010-05-25 09:52:49.000000000 +0000
> @@ -4,20 +4,22 @@
>
> ### create files, setting up ownership (type=u)
> ### some buffered IO (type=u)
> +pwrite64: Disk quota exceeded
Hmm, the test fails differently for XFS in my setting but it fails as
well. One reason is that XFS starts counting grace time when user reaches
softlimit while VFS quotas start counting grace time when user exceeds
softlimit.
Another reason probably is that limit 12 KB is too tight for XFS to write
a 4 KB file probably due to delayed allocation. So I'll try to loosen the
limits a bit to make test 230 work also for xfs. Thanks for report.
Honza
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa -- 4 4 12 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> +pwrite64: Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -26,7 +28,7 @@
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 12 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -35,24 +37,26 @@
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 none 2 2 4
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file3': Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 4 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> @@ -61,7 +65,7 @@
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 none
> +fsgqa -- 0 4 12 2 2 4 none
>
>
>
> @@ -69,20 +73,22 @@
>
> ### create files, setting up ownership (type=g)
> ### some buffered IO (type=g)
> +pwrite64: Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa -- 4 4 12 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> +pwrite64: Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -91,7 +97,7 @@
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 12 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -100,24 +106,26 @@
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 none 2 2 4
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file3': Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 4 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> @@ -126,6 +134,6 @@
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 none
> +fsgqa -- 0 4 12 2 2 4 none
>
>
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 3/8] Test basic quota enforcement
2010-05-25 10:06 ` Christoph Hellwig
2010-05-25 14:41 ` Jan Kara
@ 2010-05-25 20:39 ` Jan Kara
2010-05-27 16:30 ` Christoph Hellwig
1 sibling, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-05-25 20:39 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jan Kara, xfs
On Tue 25-05-10 06:06:35, Christoph Hellwig wrote:
> On Mon, May 24, 2010 at 04:14:14PM +0200, Jan Kara wrote:
> > Add a test which checks whether basic quota enforcement works.
>
> This one fails for me when testing and xfs filesystem on latest Linus'
> tree (with Debian -testing userspace):
OK, I've committed a fixed version of the test to the repository.
Honza
>
> --- 230.out 2010-05-25 09:49:35.000000000 +0000
> +++ 230.out.bad 2010-05-25 09:52:49.000000000 +0000
> @@ -4,20 +4,22 @@
>
> ### create files, setting up ownership (type=u)
> ### some buffered IO (type=u)
> +pwrite64: Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa -- 4 4 12 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> +pwrite64: Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -26,7 +28,7 @@
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 12 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -35,24 +37,26 @@
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 none 2 2 4
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file3': Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
> *** Report for user quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 4 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> @@ -61,7 +65,7 @@
> Block limits File limits
> User used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 none
> +fsgqa -- 0 4 12 2 2 4 none
>
>
>
> @@ -69,20 +73,22 @@
>
> ### create files, setting up ownership (type=g)
> ### some buffered IO (type=g)
> +pwrite64: Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa -- 4 4 12 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> +pwrite64: Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -91,7 +97,7 @@
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 12 4 12 00:00 2 2 4
> +fsgqa -- 0 4 12 2 2 4 00:00
>
>
> pwrite64: Disk quota exceeded
> @@ -100,24 +106,26 @@
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa +- 8 4 12 none 2 2 4
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file3': Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> +touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> touch: cannot touch `[SCR_MNT]/file5': Disk quota exceeded
> *** Report for group quotas on device [SCR_DEV]
> Block grace time: 00:00; Inode grace time: 00:00
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 4 2 4 00:00
> +fsgqa -- 0 4 12 2 2 4 none
>
>
> touch: cannot touch `[SCR_MNT]/file4': Disk quota exceeded
> @@ -126,6 +134,6 @@
> Block limits File limits
> Group used soft hard grace used soft hard grace
> ----------------------------------------------------------------------
> -fsgqa ++ 8 4 12 none 3 2 4 none
> +fsgqa -- 0 4 12 2 2 4 none
>
>
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 3/8] Test basic quota enforcement
2010-05-25 20:39 ` Jan Kara
@ 2010-05-27 16:30 ` Christoph Hellwig
2010-05-27 17:08 ` Jan Kara
0 siblings, 1 reply; 25+ messages in thread
From: Christoph Hellwig @ 2010-05-27 16:30 UTC (permalink / raw)
To: Jan Kara; +Cc: xfs
On Tue, May 25, 2010 at 10:39:15PM +0200, Jan Kara wrote:
> On Tue 25-05-10 06:06:35, Christoph Hellwig wrote:
> > On Mon, May 24, 2010 at 04:14:14PM +0200, Jan Kara wrote:
> > > Add a test which checks whether basic quota enforcement works.
> >
> > This one fails for me when testing and xfs filesystem on latest Linus'
> > tree (with Debian -testing userspace):
> OK, I've committed a fixed version of the test to the repository.
Thanks, I've pulled your updated tree. Btw, your kernel.org xfstests
tree is not a bare repo which will increase the load in the kernel.org
servers needlessly.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 3/8] Test basic quota enforcement
2010-05-27 16:30 ` Christoph Hellwig
@ 2010-05-27 17:08 ` Jan Kara
0 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-27 17:08 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jan Kara, xfs
On Thu 27-05-10 12:30:24, Christoph Hellwig wrote:
> On Tue, May 25, 2010 at 10:39:15PM +0200, Jan Kara wrote:
> > On Tue 25-05-10 06:06:35, Christoph Hellwig wrote:
> > > On Mon, May 24, 2010 at 04:14:14PM +0200, Jan Kara wrote:
> > > > Add a test which checks whether basic quota enforcement works.
> > >
> > > This one fails for me when testing and xfs filesystem on latest Linus'
> > > tree (with Debian -testing userspace):
> > OK, I've committed a fixed version of the test to the repository.
>
> Thanks, I've pulled your updated tree. Btw, your kernel.org xfstests
> tree is not a bare repo which will increase the load in the kernel.org
> servers needlessly.
Thanks! I've now removed the repo and next time when I need it I will
create a proper bare repository.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 4/8] Add test of quota accounting using fsx
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
` (2 preceding siblings ...)
2010-05-24 14:14 ` [PATCH 3/8] Test basic quota enforcement Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-06-09 17:49 ` Eric Sandeen
2010-05-24 14:14 ` [PATCH 5/8] Add quota test with fsstress Jan Kara
` (3 subsequent siblings)
7 siblings, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Run fsx (and also several fsx threads in parallel) and verify that
quota accounting is correct after they finish.
Signed-off-by: Jan Kara <jack@suse.cz>
---
231 | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
231.out | 10 ++++
group | 1 +
3 files changed, 152 insertions(+), 0 deletions(-)
create mode 100755 231
create mode 100644 231.out
diff --git a/231 b/231
new file mode 100755
index 0000000..ebbe11e
--- /dev/null
+++ b/231
@@ -0,0 +1,141 @@
+#! /bin/bash
+# FSQA Test No. 231
+#
+# Run fsx with quotas enabled and verify accounted quotas in the end
+#
+# Derived from test 127
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. 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
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+FSX_FILE_SIZE=64000000
+FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -N 20000"
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+check_usage()
+{
+ quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
+ >$tmp.orig
+ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
+ >$tmp.checked
+ quotaon -u -g $SCRATCH_MNT 2>/dev/null
+ diff $tmp.orig $tmp.checked
+}
+
+_fsx()
+{
+ tasks=$1
+ echo "=== FSX Standard Mode, Memory Mapping, $tasks Tasks ==="
+ for (( i = 1; i <= $tasks; i++ )); do
+ SEED=$RANDOM
+ echo "ltp/fsx $FSX_ARGS -S $SEED $SCRATCH_MNT/fsx_file$i" >>$seq.full
+ su $qa_user -c "ltp/fsx $FSX_ARGS -S $SEED \
+ $SCRATCH_MNT/fsx_file$i" >$tmp.output$i 2>&1 &
+ done
+
+ for (( i = 1; i <= $tasks; i++ )); do
+ if ! wait %$i; then
+ cat $tmp.output$i | tee -a $seq.full
+ wait
+ return 1
+ fi
+ $XFS_IO_PROG -F -c 'fsync' $SCRATCH_MNT/fsx_file$i
+ cat $tmp.output$i | tee -a $seq.full
+ done
+ return 0
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_user
+_need_to_be_root
+
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+
+if ! _fsx 1; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! _fsx 4; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+#flush cache after write
+FSX_ARGS="-f $FSX_ARGS"
+if ! _fsx 1; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+umount $SCRATCH_DEV 2>/dev/null
+status=0
+exit
diff --git a/231.out b/231.out
new file mode 100644
index 0000000..2f2d072
--- /dev/null
+++ b/231.out
@@ -0,0 +1,10 @@
+QA output created by 231
+=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
+All operations completed A-OK!
+=== FSX Standard Mode, Memory Mapping, 4 Tasks ===
+All operations completed A-OK!
+All operations completed A-OK!
+All operations completed A-OK!
+All operations completed A-OK!
+=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
+All operations completed A-OK!
diff --git a/group b/group
index 441e0e9..6b59c69 100644
--- a/group
+++ b/group
@@ -344,3 +344,4 @@ deprecated
228 rw auto prealloc quick
229 auto rw
230 auto quota quick
+231 auto quota
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-05-24 14:14 ` [PATCH 4/8] Add test of quota accounting using fsx Jan Kara
@ 2010-06-09 17:49 ` Eric Sandeen
2010-06-10 10:58 ` Jan Kara
2010-06-15 9:55 ` Jan Kara
0 siblings, 2 replies; 25+ messages in thread
From: Eric Sandeen @ 2010-06-09 17:49 UTC (permalink / raw)
To: Jan Kara; +Cc: hch, xfs
Jan Kara wrote:
> Run fsx (and also several fsx threads in parallel) and verify that
> quota accounting is correct after they finish.
Jan, I'm having trouble with this one on XFS for some reason, with our
RHEL6 kernel and quota-3.17...
+Disabling group quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
+Disabling user quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
+repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
+repquota: Not all specified mountpoints are using quota.
+repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
+repquota: Not all specified mountpoints are using quota.
...
however if I remove the quotaon calls (off / on settings) in check_usage()
then it works:
check_usage()
{
# quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
>$tmp.orig
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
>$tmp.checked
# quotaon -u -g $SCRATCH_MNT 2>/dev/null
diff $tmp.orig $tmp.checked
}
Seems like 2 issues: noisy disable messages, and repquota failing when disabled.
Any ideas?
Thanks,
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-09 17:49 ` Eric Sandeen
@ 2010-06-10 10:58 ` Jan Kara
2010-06-10 16:50 ` Eric Sandeen
2010-06-15 9:55 ` Jan Kara
1 sibling, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-06-10 10:58 UTC (permalink / raw)
To: Eric Sandeen; +Cc: hch, Jan Kara, xfs
On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
> Jan Kara wrote:
> > Run fsx (and also several fsx threads in parallel) and verify that
> > quota accounting is correct after they finish.
>
> Jan, I'm having trouble with this one on XFS for some reason, with our
> RHEL6 kernel and quota-3.17...
>
> +Disabling group quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
> +Disabling user quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
> +repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
> +repquota: Not all specified mountpoints are using quota.
> +repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
> +repquota: Not all specified mountpoints are using quota.
>
> ...
>
> however if I remove the quotaon calls (off / on settings) in check_usage()
> then it works:
>
> check_usage()
> {
> # quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
> repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
> >$tmp.orig
> quotacheck -u -g $SCRATCH_MNT 2>/dev/null
> repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
> >$tmp.checked
> # quotaon -u -g $SCRATCH_MNT 2>/dev/null
> diff $tmp.orig $tmp.checked
> }
>
>
> Seems like 2 issues: noisy disable messages, and repquota failing when disabled.
I've fixed noisy disable messages in quotaon (without -v flag only errors
should be printed) in CVS. With repquota & disabled quotas it's a bit more
complicated. The problem is that for ext?, reiserfs,... you have to disable
quotas before running quotacheck. Also quotacheck is NOP for XFS - we'd
rather need to call something to really recompute quota usage for XFS. How
that can be done?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-10 10:58 ` Jan Kara
@ 2010-06-10 16:50 ` Eric Sandeen
2010-06-10 20:43 ` Eric Sandeen
2010-06-14 10:48 ` Jan Kara
0 siblings, 2 replies; 25+ messages in thread
From: Eric Sandeen @ 2010-06-10 16:50 UTC (permalink / raw)
To: Jan Kara; +Cc: hch, xfs
Jan Kara wrote:
> On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
>> Jan Kara wrote:
>>> Run fsx (and also several fsx threads in parallel) and verify that
>>> quota accounting is correct after they finish.
>> Jan, I'm having trouble with this one on XFS for some reason, with our
>> RHEL6 kernel and quota-3.17...
>>
>> +Disabling group quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
>> +Disabling user quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
>> +repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
>> +repquota: Not all specified mountpoints are using quota.
>> +repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
>> +repquota: Not all specified mountpoints are using quota.
>>
>> ...
>>
>> however if I remove the quotaon calls (off / on settings) in check_usage()
>> then it works:
>>
>> check_usage()
>> {
>> # quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
>> repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
>> >$tmp.orig
>> quotacheck -u -g $SCRATCH_MNT 2>/dev/null
>> repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
>> >$tmp.checked
>> # quotaon -u -g $SCRATCH_MNT 2>/dev/null
>> diff $tmp.orig $tmp.checked
>> }
>>
>>
>> Seems like 2 issues: noisy disable messages, and repquota failing when disabled.
> I've fixed noisy disable messages in quotaon (without -v flag only errors
> should be printed) in CVS.
Ok, we should probably just add a filter for these so that it'll work
on older versions.
> With repquota & disabled quotas it's a bit more
> complicated.
Hm I'm still woefully unfamiliar with quota intricacies.
It seems that after quotaon -f, repquota fails on xfs but works for ext*?
Not sure if that's intended...
Also is there a reason to disable quota before repquota? Is disable/enable
around quotacheck enough?
Hm on ext* I'm also getting differences from the expected output; I suspect
due to selinux xattrs. I'll try to get that fixed up.
> The problem is that for ext?, reiserfs,... you have to disable
> quotas before running quotacheck. Also quotacheck is NOP for XFS - we'd
> rather need to call something to really recompute quota usage for XFS. How
> that can be done?
It's regenerated at mount time if needed. I don't know that we have a
method to force this recalculation... I guess mounting with quotas disabled,
unmounting, then mounting again w/ quotas on will do it.
Thanks,
-Eric
> Honza
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-10 16:50 ` Eric Sandeen
@ 2010-06-10 20:43 ` Eric Sandeen
2010-06-14 12:46 ` Jan Kara
2010-06-14 10:48 ` Jan Kara
1 sibling, 1 reply; 25+ messages in thread
From: Eric Sandeen @ 2010-06-10 20:43 UTC (permalink / raw)
To: Jan Kara; +Cc: hch, xfs
Eric Sandeen wrote:
> Jan Kara wrote:
>> On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
>>> Jan Kara wrote:
>>>> Run fsx (and also several fsx threads in parallel) and verify that
>>>> quota accounting is correct after they finish.
>>> Jan, I'm having trouble with this one on XFS for some reason, with our
>>> RHEL6 kernel and quota-3.17...
These don't seem to be working properly at all with xfs.
In quota-3.17, quotaoff seems to turn off both accounting and enforcement,
despite what the man page says -
To turn off quota limit enforcement on any XFS filesystem, first make sure
that quota accounting and enforcement are both turned on using repquota -v
filesystem. Then, use quotaoff -v filesystem to disable limit enforce-
ment. This may be done while the filesystem is mounted.
And once accounting is turned off, it can't be re-enabled without a remount.
With quota-4.0.0-preX, it seems to turn off -neither- accounting nor enforcement,
based on hch's test:
[14:59] <hch> qemu1:~/xfstests-dev# mount -o quota /dev/vdb5 /mnt/test
[14:59] <hch> qemu1:~/xfstests-dev# quotaon -f /dev/vdb5
[15:00] <hch> qemu1:~/xfstests-dev# quotaon /dev/vdb5
[15:00] <hch> quotaon: Enable XFS group quota accounting during mount
[15:00] <hch> quotaon: Enforcing user quota already on /dev/vdb5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Argh ;)
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-10 20:43 ` Eric Sandeen
@ 2010-06-14 12:46 ` Jan Kara
0 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-06-14 12:46 UTC (permalink / raw)
To: Eric Sandeen; +Cc: hch, Jan Kara, xfs
On Thu 10-06-10 15:43:44, Eric Sandeen wrote:
> Eric Sandeen wrote:
> > Jan Kara wrote:
> >> On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
> >>> Jan Kara wrote:
> >>>> Run fsx (and also several fsx threads in parallel) and verify that
> >>>> quota accounting is correct after they finish.
> >>> Jan, I'm having trouble with this one on XFS for some reason, with our
> >>> RHEL6 kernel and quota-3.17...
>
> These don't seem to be working properly at all with xfs.
>
> In quota-3.17, quotaoff seems to turn off both accounting and enforcement,
> despite what the man page says -
>
> To turn off quota limit enforcement on any XFS filesystem, first make sure
> that quota accounting and enforcement are both turned on using repquota -v
> filesystem. Then, use quotaoff -v filesystem to disable limit enforce-
> ment. This may be done while the filesystem is mounted.
>
> And once accounting is turned off, it can't be re-enabled without a remount.
>
> With quota-4.0.0-preX, it seems to turn off -neither- accounting nor enforcement,
> based on hch's test:
>
> [14:59] <hch> qemu1:~/xfstests-dev# mount -o quota /dev/vdb5 /mnt/test
> [14:59] <hch> qemu1:~/xfstests-dev# quotaon -f /dev/vdb5
> [15:00] <hch> qemu1:~/xfstests-dev# quotaon /dev/vdb5
> [15:00] <hch> quotaon: Enable XFS group quota accounting during mount
> [15:00] <hch> quotaon: Enforcing user quota already on /dev/vdb5
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Argh ;)
Ah, not many people seem to use quotaon(8) with XFS :). The fact that we
turned off both enforcement and accounting was originally intended I think
(Nathan Scott wrote the code) but I agree with you that it makes more sence
to turn off just enforcement as is stated in the manpage. The check in
quotaon.c:newstate() was buggy and worked only by luck for XFS. After I
fixed error checking of kern_quota_on the check stopped working...
I have now committed changes to quota-tools and checked that quotaon now
works reasonably with XFS so it should be cleaned up hopefully.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-10 16:50 ` Eric Sandeen
2010-06-10 20:43 ` Eric Sandeen
@ 2010-06-14 10:48 ` Jan Kara
1 sibling, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-06-14 10:48 UTC (permalink / raw)
To: Eric Sandeen; +Cc: hch, Jan Kara, xfs
On Thu 10-06-10 11:50:59, Eric Sandeen wrote:
> Jan Kara wrote:
> > On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
> >> Jan Kara wrote:
> >>> Run fsx (and also several fsx threads in parallel) and verify that
> >>> quota accounting is correct after they finish.
> >> Jan, I'm having trouble with this one on XFS for some reason, with our
> >> RHEL6 kernel and quota-3.17...
> >>
> >> +Disabling group quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
> >> +Disabling user quota enforcement and accounting on /dev/mapper/VolGroup00-testvol2
> >> +repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
> >> +repquota: Not all specified mountpoints are using quota.
> >> +repquota: Mountpoint (or device) /mnt/testarea/scratch not found or has no quota enabled.
> >> +repquota: Not all specified mountpoints are using quota.
> >>
> >> ...
> >>
> >> however if I remove the quotaon calls (off / on settings) in check_usage()
> >> then it works:
> >>
> >> check_usage()
> >> {
> >> # quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
> >> repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
> >> >$tmp.orig
> >> quotacheck -u -g $SCRATCH_MNT 2>/dev/null
> >> repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
> >> >$tmp.checked
> >> # quotaon -u -g $SCRATCH_MNT 2>/dev/null
> >> diff $tmp.orig $tmp.checked
> >> }
> >>
> >>
> >> Seems like 2 issues: noisy disable messages, and repquota failing when disabled.
> > I've fixed noisy disable messages in quotaon (without -v flag only errors
> > should be printed) in CVS.
>
> Ok, we should probably just add a filter for these so that it'll work
> on older versions.
OK, will add that.
> > With repquota & disabled quotas it's a bit more
> > complicated.
>
> Hm I'm still woefully unfamiliar with quota intricacies.
>
> It seems that after quotaon -f, repquota fails on xfs but works for ext*?
Yes, because we disabled also accounting. But with your change to quota
tools it shouldn't be a problem anymore. Still I've added a test so that
we turn quotas off only for ext? and reiserfs so that the tests work with
older quota tools as well.
> Not sure if that's intended...
>
> Also is there a reason to disable quota before repquota? Is disable/enable
> around quotacheck enough?
Yes, that would be enough.
> Hm on ext* I'm also getting differences from the expected output; I suspect
> due to selinux xattrs. I'll try to get that fixed up.
I'm seeing some quota miscomputations for ext4, but ext2 and ext3 work
fine for me. I didn't have time to look into why ext4 after quotacheck
reports different number of blocks. Maybe it's just delayed allocation,
maybe it's a real bug.
> > The problem is that for ext?, reiserfs,... you have to disable
> > quotas before running quotacheck. Also quotacheck is NOP for XFS - we'd
> > rather need to call something to really recompute quota usage for XFS. How
> > that can be done?
>
> It's regenerated at mount time if needed. I don't know that we have a
> method to force this recalculation... I guess mounting with quotas disabled,
> unmounting, then mounting again w/ quotas on will do it.
OK, I'll add this to the test.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-09 17:49 ` Eric Sandeen
2010-06-10 10:58 ` Jan Kara
@ 2010-06-15 9:55 ` Jan Kara
2010-07-26 21:46 ` Eric Sandeen
1 sibling, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-06-15 9:55 UTC (permalink / raw)
To: Eric Sandeen; +Cc: hch, Jan Kara, xfs
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
> Jan Kara wrote:
> > Run fsx (and also several fsx threads in parallel) and verify that
> > quota accounting is correct after they finish.
>
> Jan, I'm having trouble with this one on XFS for some reason, with our
> RHEL6 kernel and quota-3.17...
OK, attached is an improvement to the XFSQA tests after which all quota
tests pass for XFS just fine.
The second patch is just minor general improvement of _require_scratch
macro.
Could they be added to XFSQA repository? Thanks.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
[-- Attachment #2: 0001-Provide-generic-function-for-checking-quota-usage.patch --]
[-- Type: text/x-patch, Size: 5593 bytes --]
>From 5f184d21e781f1b14365c356e6c80030964aaaf7 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Thu, 10 Jun 2010 12:49:11 +0200
Subject: [PATCH 1/2] Provide generic function for checking quota usage
Provide generic function _check_quota_usage for checking whether quota usage
matches the space used and use it in proper tests.
Signed-off-by: Jan Kara <jack@suse.cz>
---
231 | 18 +++---------------
231.out | 6 ++++++
232 | 14 +-------------
232.out | 2 ++
233 | 14 +-------------
233.out | 2 ++
common.quota | 36 ++++++++++++++++++++++++++++++++++++
7 files changed, 51 insertions(+), 41 deletions(-)
diff --git a/231 b/231
index ebbe11e..e499c9a 100755
--- a/231
+++ b/231
@@ -49,18 +49,6 @@ s,$SCRATCH_DEV,[SCR_DEV],;
print;"
}
-check_usage()
-{
- quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
- repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
- >$tmp.orig
- quotacheck -u -g $SCRATCH_MNT 2>/dev/null
- repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch \
- >$tmp.checked
- quotaon -u -g $SCRATCH_MNT 2>/dev/null
- diff $tmp.orig $tmp.checked
-}
-
_fsx()
{
tasks=$1
@@ -104,7 +92,7 @@ if ! _fsx 1; then
exit
fi
-if ! check_usage; then
+if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
status=1
exit
@@ -116,7 +104,7 @@ if ! _fsx 4; then
exit
fi
-if ! check_usage; then
+if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
status=1
exit
@@ -130,7 +118,7 @@ if ! _fsx 1; then
exit
fi
-if ! check_usage; then
+if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
status=1
exit
diff --git a/231.out b/231.out
index 2f2d072..ef264a9 100644
--- a/231.out
+++ b/231.out
@@ -1,10 +1,16 @@
QA output created by 231
=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
All operations completed A-OK!
+Comparing user usage
+Comparing group usage
=== FSX Standard Mode, Memory Mapping, 4 Tasks ===
All operations completed A-OK!
All operations completed A-OK!
All operations completed A-OK!
All operations completed A-OK!
+Comparing user usage
+Comparing group usage
=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
All operations completed A-OK!
+Comparing user usage
+Comparing group usage
diff --git a/232 b/232
index cf4d25a..d5f99bd 100755
--- a/232
+++ b/232
@@ -46,18 +46,6 @@ s,$SCRATCH_DEV,[SCR_DEV],;
print;"
}
-check_usage()
-{
- quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
- repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
- sort >$tmp.orig
- quotacheck -u -g $SCRATCH_MNT 2>/dev/null
- repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
- sort >$tmp.checked
- quotaon -u -g $SCRATCH_MNT 2>/dev/null
- diff $tmp.orig $tmp.checked
-}
-
_filter_num()
{
tee -a $here/$seq.full |\
@@ -104,7 +92,7 @@ if ! _fsstress; then
exit
fi
-if ! check_usage; then
+if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
status=1
exit
diff --git a/232.out b/232.out
index 744192e..ef82a89 100644
--- a/232.out
+++ b/232.out
@@ -4,3 +4,5 @@ Testing fsstress
fsstress -n 2000 -d outdir -p 7
seed = S
+Comparing user usage
+Comparing group usage
diff --git a/233 b/233
index b967e0d..5060931 100755
--- a/233
+++ b/233
@@ -50,18 +50,6 @@ s,$SCRATCH_DEV,[SCR_DEV],;
print;"
}
-check_usage()
-{
- quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
- repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
- sort >$tmp.orig
- quotacheck -u -g $SCRATCH_MNT 2>/dev/null
- repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
- sort >$tmp.checked
- quotaon -u -g $SCRATCH_MNT 2>/dev/null
- diff $tmp.orig $tmp.checked
-}
-
_filter_num()
{
tee -a $here/$seq.full |\
@@ -113,7 +101,7 @@ if ! _fsstress; then
exit
fi
-if ! check_usage; then
+if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
status=1
exit
diff --git a/233.out b/233.out
index 208910d..fa36ca3 100644
--- a/233.out
+++ b/233.out
@@ -4,3 +4,5 @@ Testing fsstress
fsstress -z -f rmdir=20 -f link=10 -f creat=10 -f mkdir=10 -f unlink=20 -f symlink=10 -f rename=10 -f fsync=2 -f write=15 -f dwrite=15 -n 5000 -d outdir -p 7
seed = S
+Comparing user usage
+Comparing group usage
diff --git a/common.quota b/common.quota
index d32e285..655e34d 100644
--- a/common.quota
+++ b/common.quota
@@ -211,5 +211,41 @@ _qmount_option()
echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seq.full
}
+_check_quota_usage()
+{
+ # Sync to get delalloc to disk
+ sync
+ VFS_QUOTA=0
+ if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP = "reiserfs" ]; then
+ VFS_QUOTA=1
+ quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
+ fi
+ repquota -u -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.user.orig
+ repquota -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.group.orig
+ if [ $VFS_QUOTA -eq 1 ]; then
+ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+ else
+ # use XFS method to force quotacheck
+ mount -o remount,noquota $SCRATCH_DEV
+ mount -o remount,usrquota,grpquota $SCRATCH_DEV
+ fi
+ repquota -u -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.user.checked
+ repquota -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.group.checked
+ if [ $VFS_QUOTA -eq 1 ]; then
+ quotaon -u -g $SCRATCH_MNT 2>/dev/null
+ fi
+ {
+ echo "Comparing user usage"
+ diff $tmp.user.orig $tmp.user.checked
+ } && {
+ echo "Comparing group usage"
+ diff $tmp.group.orig $tmp.group.checked
+ }
+}
+
# make sure this script returns success
/bin/true
--
1.6.4.2
[-- Attachment #3: 0002-Add-test-for-correct-SCRATCH_MNT-into-_require_scrat.patch --]
[-- Type: text/x-patch, Size: 643 bytes --]
>From d72c11b63aa22c920b460a71d4384c2f39be6513 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Tue, 15 Jun 2010 10:54:12 +0200
Subject: [PATCH 2/2] Add test for correct $SCRATCH_MNT into _require_scratch
---
common.rc | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/common.rc b/common.rc
index 6bf1e12..72997f9 100644
--- a/common.rc
+++ b/common.rc
@@ -703,6 +703,10 @@ _require_scratch()
then
_notrun "this test requires a valid \$SCRATCH_DEV"
fi
+ if [ ! -d "$SCRATCH_MNT" ]
+ then
+ _notrun "this test requires a valid \$SCRATCH_MNT"
+ fi
;;
esac
--
1.6.4.2
[-- Attachment #4: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-06-15 9:55 ` Jan Kara
@ 2010-07-26 21:46 ` Eric Sandeen
2010-07-27 8:15 ` Jan Kara
0 siblings, 1 reply; 25+ messages in thread
From: Eric Sandeen @ 2010-07-26 21:46 UTC (permalink / raw)
To: Jan Kara; +Cc: hch, ext4 development, xfs
On 06/15/2010 04:55 AM, Jan Kara wrote:
> On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
>> Jan Kara wrote:
>>> Run fsx (and also several fsx threads in parallel) and verify that
>>> quota accounting is correct after they finish.
>>
>> Jan, I'm having trouble with this one on XFS for some reason, with our
>> RHEL6 kernel and quota-3.17...
> OK, attached is an improvement to the XFSQA tests after which all quota
> tests pass for XFS just fine.
> The second patch is just minor general improvement of _require_scratch
> macro.
> Could they be added to XFSQA repository? Thanks.
Jan, I've got some ext4 failures reported on these, although I can't hit
them, so not quite sure what's going on.
In 231:
+< fsgqa -- 760 0 0 3 0 0
+---
+> fsgqa -- 764 0 0 3 0 0
+14c14
+< fsgqa -- 760 0 0 3 0 0
+---
+> fsgqa -- 764 0 0 3 0 0
after the quotacheck & repquota we have 4 more blocks. Maybe this
is due to my accounting of metadata blocks at write time, and not
before ... would it be reasonable to put a sync call as the first
line of check_usage() ?
Also in 233:
+< #501 -- 15392 0 0 998 0 0
+< #501 -- 15392 32000 32000 998 1000 1000
+---
+> #501 +- 32084 32000 32000 7days 998 1000 1000
+> #501 -- 32084 0 0 998 0 0
"7days" magically appeared after the quotacheck. Not sure what's going
on there...
Thanks,
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-07-26 21:46 ` Eric Sandeen
@ 2010-07-27 8:15 ` Jan Kara
2010-07-27 8:48 ` Jan Kara
0 siblings, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-07-27 8:15 UTC (permalink / raw)
To: Eric Sandeen; +Cc: hch, ext4 development, Jan Kara, xfs
On Mon 26-07-10 16:46:17, Eric Sandeen wrote:
> On 06/15/2010 04:55 AM, Jan Kara wrote:
> > On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
> >> Jan Kara wrote:
> >>> Run fsx (and also several fsx threads in parallel) and verify that
> >>> quota accounting is correct after they finish.
> >>
> >> Jan, I'm having trouble with this one on XFS for some reason, with our
> >> RHEL6 kernel and quota-3.17...
> > OK, attached is an improvement to the XFSQA tests after which all quota
> > tests pass for XFS just fine.
> > The second patch is just minor general improvement of _require_scratch
> > macro.
> > Could they be added to XFSQA repository? Thanks.
>
> Jan, I've got some ext4 failures reported on these, although I can't hit
> them, so not quite sure what's going on.
>
> In 231:
>
> +< fsgqa -- 760 0 0 3 0 0
> +---
> +> fsgqa -- 764 0 0 3 0 0
> +14c14
> +< fsgqa -- 760 0 0 3 0 0
> +---
> +> fsgqa -- 764 0 0 3 0 0
>
> after the quotacheck & repquota we have 4 more blocks. Maybe this
> is due to my accounting of metadata blocks at write time, and not
> before ... would it be reasonable to put a sync call as the first
> line of check_usage() ?
Just last week a change went into xfstests which introduces a generic
quota checking function and uses sync before getting quota usage. I think
xfstests passed for me with ext4 after this change but I've now restarted
the tests to recheck it.
> Also in 233:
>
> +< #501 -- 15392 0 0 998 0 0
> +< #501 -- 15392 32000 32000 998 1000 1000
> +---
> +> #501 +- 32084 32000 32000 7days 998 1000 1000
> +> #501 -- 32084 0 0 998 0 0
>
> "7days" magically appeared after the quotacheck. Not sure what's going
> on there...
That's because the usage after checking exceeded block soft limit and
thus grace time has been set. So it's the same problem as in the above
test.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-07-27 8:15 ` Jan Kara
@ 2010-07-27 8:48 ` Jan Kara
2010-07-27 13:11 ` Eric Sandeen
0 siblings, 1 reply; 25+ messages in thread
From: Jan Kara @ 2010-07-27 8:48 UTC (permalink / raw)
To: Eric Sandeen; +Cc: hch, ext4 development, Jan Kara, xfs
On Tue 27-07-10 10:15:38, Jan Kara wrote:
> On Mon 26-07-10 16:46:17, Eric Sandeen wrote:
> > On 06/15/2010 04:55 AM, Jan Kara wrote:
> > > On Wed 09-06-10 12:49:49, Eric Sandeen wrote:
> > >> Jan Kara wrote:
> > >>> Run fsx (and also several fsx threads in parallel) and verify that
> > >>> quota accounting is correct after they finish.
> > >>
> > >> Jan, I'm having trouble with this one on XFS for some reason, with our
> > >> RHEL6 kernel and quota-3.17...
> > > OK, attached is an improvement to the XFSQA tests after which all quota
> > > tests pass for XFS just fine.
> > > The second patch is just minor general improvement of _require_scratch
> > > macro.
> > > Could they be added to XFSQA repository? Thanks.
> >
> > Jan, I've got some ext4 failures reported on these, although I can't hit
> > them, so not quite sure what's going on.
> >
> > In 231:
> >
> > +< fsgqa -- 760 0 0 3 0 0
> > +---
> > +> fsgqa -- 764 0 0 3 0 0
> > +14c14
> > +< fsgqa -- 760 0 0 3 0 0
> > +---
> > +> fsgqa -- 764 0 0 3 0 0
> >
> > after the quotacheck & repquota we have 4 more blocks. Maybe this
> > is due to my accounting of metadata blocks at write time, and not
> > before ... would it be reasonable to put a sync call as the first
> > line of check_usage() ?
> Just last week a change went into xfstests which introduces a generic
> quota checking function and uses sync before getting quota usage. I think
> xfstests passed for me with ext4 after this change but I've now restarted
> the tests to recheck it.
For me all the quota tests pass just fine with ext4 and the latest
xfstests... So does the latest version work also for you?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 4/8] Add test of quota accounting using fsx
2010-07-27 8:48 ` Jan Kara
@ 2010-07-27 13:11 ` Eric Sandeen
0 siblings, 0 replies; 25+ messages in thread
From: Eric Sandeen @ 2010-07-27 13:11 UTC (permalink / raw)
To: Jan Kara; +Cc: hch@infradead.org, ext4 development, xfs@oss.sgi.com
On Jul 27, 2010, at 3:48 AM, Jan Kara <jack@suse.cz> wrote:
>>>
>> Just last week a change went into xfstests which introduces a generic
>> quota checking function and uses sync before getting quota usage. I think
>> xfstests passed for me with ext4 after this change but I've now restarted
>> the tests to recheck it.
> For me all the quota tests pass just fine with ext4 and the latest
> xfstests... So does the latest version work also for you?
>
Whoops sorry, they do pass for me in the devel tree; I had missed that recent change and I guess our qa had tested a tree without it. I wondered why it didn't work for them... Sorry for the noise....
Eric
> Honza
> --
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 5/8] Add quota test with fsstress
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
` (3 preceding siblings ...)
2010-05-24 14:14 ` [PATCH 4/8] Add test of quota accounting using fsx Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-05-24 14:14 ` [PATCH 6/8] Add quota accounting test when fsstress is run and quota limits are set low Jan Kara
` (2 subsequent siblings)
7 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Run fsstress and verify that quota accounting is correct after it finishes.
Signed-off-by: Jan Kara <jack@suse.cz>
---
232 | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
232.out | 6 +++
group | 1 +
3 files changed, 122 insertions(+), 0 deletions(-)
create mode 100755 232
create mode 100644 232.out
diff --git a/232 b/232
new file mode 100755
index 0000000..cf4d25a
--- /dev/null
+++ b/232
@@ -0,0 +1,115 @@
+#! /bin/bash
+# FSQA Test No. 232
+#
+# Run fsstress with quotas enabled and verify accounted quotas in the end
+#
+# Derived from test 231
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. 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
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+check_usage()
+{
+ quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.orig
+ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.checked
+ quotaon -u -g $SCRATCH_MNT 2>/dev/null
+ diff $tmp.orig $tmp.checked
+}
+
+_filter_num()
+{
+ tee -a $here/$seq.full |\
+ sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
+ -e 's/[0-9][0-9]* paths/P paths/g' \
+ -e 's/seed = [0-9][0-9]*/seed = S/'
+}
+
+_fsstress()
+{
+ echo ""
+ echo "Testing fsstress"
+ echo ""
+
+ out=$SCRATCH_MNT/fsstress.$$
+ count=2000
+ args="-n $count -d $out -p 7"
+
+ echo "fsstress $args" | tee -a $here/$seq.full | sed -e "s#$out#outdir#"
+ if ! $FSSTRESS_PROG $args | tee -a $here/$seq.full | _filter_num
+ then
+ echo " fsstress $args returned $?"
+ cat $tmp.out | tee -a $here/$seq.full
+ status=1
+ fi
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_need_to_be_root
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+
+if ! _fsstress; then
+ umount $SCRATCH_DEV 2>/dev/null
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+umount $SCRATCH_DEV 2>/dev/null
+status=0
+exit
diff --git a/232.out b/232.out
new file mode 100644
index 0000000..744192e
--- /dev/null
+++ b/232.out
@@ -0,0 +1,6 @@
+QA output created by 232
+
+Testing fsstress
+
+fsstress -n 2000 -d outdir -p 7
+seed = S
diff --git a/group b/group
index 6b59c69..c8cd774 100644
--- a/group
+++ b/group
@@ -345,3 +345,4 @@ deprecated
229 auto rw
230 auto quota quick
231 auto quota
+232 auto quota
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH 6/8] Add quota accounting test when fsstress is run and quota limits are set low
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
` (4 preceding siblings ...)
2010-05-24 14:14 ` [PATCH 5/8] Add quota test with fsstress Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-05-24 14:14 ` [PATCH 7/8] Add test of quota limit and info setting Jan Kara
2010-05-24 14:14 ` [PATCH 8/8] Add test for quota accounting after remount read only Jan Kara
7 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Test various error recovery paths whether they properly handle EDQUOT failures.
Signed-off-by: Jan Kara <jack@suse.cz>
---
233 | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
233.out | 6 +++
group | 1 +
3 files changed, 131 insertions(+), 0 deletions(-)
create mode 100755 233
create mode 100644 233.out
diff --git a/233 b/233
new file mode 100755
index 0000000..b967e0d
--- /dev/null
+++ b/233
@@ -0,0 +1,124 @@
+#! /bin/bash
+# FSQA Test No. 233
+#
+# Run fsstress with quotas enabled and limits set low and verify accounted
+# quotas in the end
+#
+# Derived from test 231
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. 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
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+FSX_FILE_SIZE=64000000
+FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+check_usage()
+{
+ quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.orig
+ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ sort >$tmp.checked
+ quotaon -u -g $SCRATCH_MNT 2>/dev/null
+ diff $tmp.orig $tmp.checked
+}
+
+_filter_num()
+{
+ tee -a $here/$seq.full |\
+ sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
+ -e 's/[0-9][0-9]* paths/P paths/g' \
+ -e 's/seed = [0-9][0-9]*/seed = S/'
+}
+
+_fsstress()
+{
+ echo ""
+ echo "Testing fsstress"
+ echo ""
+
+ out=$SCRATCH_MNT/fsstress.$$
+ count=5000
+ args="-z \
+-f rmdir=20 -f link=10 -f creat=10 -f mkdir=10 -f unlink=20 -f symlink=10 \
+-f rename=10 -f fsync=2 -f write=15 -f dwrite=15 \
+-n $count -d $out -p 7"
+
+ echo "fsstress $args" | tee -a $here/$seq.full | sed -e "s#$out#outdir#"
+ if ! su $qa_user -c "$FSSTRESS_PROG $args" | tee -a $here/$seq.full | _filter_num
+ then
+ echo " fsstress $args returned $?"
+ cat $tmp.out | tee -a $here/$seq.full
+ status=1
+ fi
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_user
+_need_to_be_root
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null
+
+if ! _fsstress; then
+ umount $SCRATCH_DEV 2>/dev/null
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+umount $SCRATCH_DEV 2>/dev/null
+status=0
+exit
diff --git a/233.out b/233.out
new file mode 100644
index 0000000..208910d
--- /dev/null
+++ b/233.out
@@ -0,0 +1,6 @@
+QA output created by 233
+
+Testing fsstress
+
+fsstress -z -f rmdir=20 -f link=10 -f creat=10 -f mkdir=10 -f unlink=20 -f symlink=10 -f rename=10 -f fsync=2 -f write=15 -f dwrite=15 -n 5000 -d outdir -p 7
+seed = S
diff --git a/group b/group
index c8cd774..cc9bdb2 100644
--- a/group
+++ b/group
@@ -346,3 +346,4 @@ deprecated
230 auto quota quick
231 auto quota
232 auto quota
+233 auto quota
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH 7/8] Add test of quota limit and info setting
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
` (5 preceding siblings ...)
2010-05-24 14:14 ` [PATCH 6/8] Add quota accounting test when fsstress is run and quota limits are set low Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
2010-05-24 14:14 ` [PATCH 8/8] Add test for quota accounting after remount read only Jan Kara
7 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Add test stressing addition and removal of quota structures and setting
of quota grace time.
Signed-off-by: Jan Kara <jack@suse.cz>
---
234 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
234.out | 4 ++
group | 1 +
3 files changed, 113 insertions(+), 0 deletions(-)
create mode 100755 234
create mode 100644 234.out
diff --git a/234 b/234
new file mode 100755
index 0000000..4e98035
--- /dev/null
+++ b/234
@@ -0,0 +1,108 @@
+#! /bin/bash
+# FS QA Test No. 234
+#
+# Stress setquota and setinfo handling.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2010 Jan Kara. All Rights Reserved.
+#
+# Based on test 219,
+# Copyright (c) 2005 Silicon Graphics, Inc. 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
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+test_setting()
+{
+ echo; echo "### test limits and info setting"
+ count=2000
+ procs=5
+ idmod=200000
+ seed=$RANDOM
+ RANDOM=$seed
+ echo "Starting test with procs=$procs, idmod=$idmod, and seed=$seed" >>$seq.full
+
+ for (( i = 0; i < $procs; i++ )); do
+ ( SETUCOUNT=1; SETGCOUNT=1; SETUIDS[0]=0; SETGIDS[0]=0
+ for (( j = 0; j < $count; j++ )); do
+ OP=$(($RANDOM%22))
+ UG=$(($OP%2))
+ OP=$(($OP/2))
+ if [ $UG -eq 1 ]; then
+ type='u'
+ else
+ type='g'
+ fi
+ if [ $OP -eq 10 ]; then
+ setquota -t -$type $j $j $SCRATCH_MNT
+ elif [ $OP -lt 5 ]; then
+ ID=$((($RANDOM*32768+$RANDOM)%$idmod))
+ if [ $UG -eq 1 ]; then
+ SETUIDS[$SETUCOUNT]=$ID
+ SETUCOUNT=$(($SETUCOUNT+1))
+ else
+ SETGIDS[$SETGCOUNT]=$ID
+ SETGCOUNT=$(($SETGCOUNT+1))
+ fi
+ setquota -$type $ID $j $j $j $j $SCRATCH_MNT
+ else
+ if [ $UG -eq 1 ]; then
+ ID=${SETUIDS[$(($RANDOM%$SETUCOUNT))]}
+ else
+ ID=${SETGIDS[$(($RANDOM%$SETGCOUNT))]}
+ fi
+ setquota -$type $ID 0 0 0 0 $SCRATCH_MNT
+ fi
+ done )&
+ done
+ wait
+ echo "### done with testing"
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux #IRIX
+_require_scratch
+_require_quota
+_need_to_be_root
+
+# real QA test starts here
+rm -f $seq.full
+
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+test_setting
+umount $SCRATCH_DEV
+
+status=0
+exit
diff --git a/234.out b/234.out
new file mode 100644
index 0000000..78d1587
--- /dev/null
+++ b/234.out
@@ -0,0 +1,4 @@
+QA output created by 234
+
+### test limits and info setting
+### done with testing
diff --git a/group b/group
index cc9bdb2..3a95e48 100644
--- a/group
+++ b/group
@@ -347,3 +347,4 @@ deprecated
231 auto quota
232 auto quota
233 auto quota
+234 auto quota
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH 8/8] Add test for quota accounting after remount read only
2010-05-24 14:14 [PATCH 0/8 v3] Quota tests for XFSQA Jan Kara
` (6 preceding siblings ...)
2010-05-24 14:14 ` [PATCH 7/8] Add test of quota limit and info setting Jan Kara
@ 2010-05-24 14:14 ` Jan Kara
7 siblings, 0 replies; 25+ messages in thread
From: Jan Kara @ 2010-05-24 14:14 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Check that quota accounting works after remounting read-only and
then back read-write.
Signed-off-by: Jan Kara <jack@suse.cz>
---
235 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
235.out | 34 +++++++++++++++++++++++++
group | 1 +
3 files changed, 118 insertions(+), 0 deletions(-)
create mode 100755 235
create mode 100644 235.out
diff --git a/235 b/235
new file mode 100755
index 0000000..97632e5
--- /dev/null
+++ b/235
@@ -0,0 +1,83 @@
+#! /bin/bash
+# FS QA Test No. 235
+#
+# Test whether quota gets properly reenabled after remount read-write
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2010 Jan Kara. All Rights Reserved.
+#
+# Based on test 219,
+# Copyright (c) 2005 Silicon Graphics, Inc. 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
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux #IRIX
+_require_scratch
+_require_quota
+_require_user
+_need_to_be_root
+
+# real QA test starts here
+rm -f $seq.full
+
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon $SCRATCH_MNT 2>/dev/null
+
+touch $SCRATCH_MNT/testfile
+chown $qa_user:$qa_user $SCRATCH_MNT/testfile
+
+repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch
+
+mount -o remount,ro $SCRATCH_DEV 2>&1 | tee -a $seq.full | filter_scratch
+touch $SCRATCH_MNT/failed 2>&1 | tee -a $seq.full | filter_scratch
+mount -o remount,rw $SCRATCH_DEV 2>&1 | tee -a $seq.full | filter_scratch
+
+$XFS_IO_PROG -F -c 'pwrite 0 16k' -c 'fsync' \
+ $SCRATCH_MNT/testfile >>$seq.full 2>&1
+repquota -u -g $SCRATCH_MNT | grep -v "^root" | filter_scratch
+
+umount $SCRATCH_DEV 2>/dev/null
+
+status=0
+exit
diff --git a/235.out b/235.out
new file mode 100644
index 0000000..8d3eb1f
--- /dev/null
+++ b/235.out
@@ -0,0 +1,34 @@
+QA output created by 235
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 7days; Inode grace time: 7days
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa -- 0 0 0 1 0 0
+
+
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 7days; Inode grace time: 7days
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa -- 0 0 0 1 0 0
+
+
+touch: cannot touch `[SCR_MNT]/failed': Read-only file system
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 7days; Inode grace time: 7days
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa -- 16 0 0 1 0 0
+
+
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 7days; Inode grace time: 7days
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+fsgqa -- 16 0 0 1 0 0
+
+
diff --git a/group b/group
index 3a95e48..6b915b2 100644
--- a/group
+++ b/group
@@ -348,3 +348,4 @@ deprecated
232 auto quota
233 auto quota
234 auto quota
+235 auto quota quick
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 25+ messages in thread