linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] xfstests: optionally run all tests under quota
Date: Tue, 09 Feb 2010 13:26:31 -0600	[thread overview]
Message-ID: <4B71B6E7.1000203@redhat.com> (raw)

This patch might be a little heavy handed, but it seems to
work; if you set USE_QUOTA=1 in your environment, all
tests should be run with quota on and enabled.

This will hopefully help shake out some of the ext4
quota problems, although one needs to keep an eye
on the console to see whether warnings scroll by.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common.rc b/common.rc
index 6424871..4fde921 100644
--- a/common.rc
+++ b/common.rc
@@ -64,6 +64,9 @@ _mount_opts()
     *)
 	;;
     esac
+    if [ ! -z "$USE_QUOTA" ]; then
+	export MOUNT_OPTIONS="$MOUNT_OPTIONS -o usrquota,grpquota"
+    fi
 }
 
 _mkfs_opts()
@@ -161,6 +164,10 @@ _test_options()
     type=$1
     TEST_OPTIONS=""
 
+    if [ ! -z "$USE_QUOTA" ]; then
+	TEST_OPTIONS="-o usrquota,grpquota"
+    fi
+
     if [ "$FSTYP" != "xfs" ]; then
         return
     fi
@@ -202,6 +209,25 @@ _mount_ops_filter()
 
 }
 
+_setup_quota()
+{
+    mountpoint=$1
+    if [ ! -z "$USE_QUOTA" ]; then
+	case $FSTYP in
+	xfs)
+	    ;;
+	ext*|reiserfs)
+	    quotaoff $mountpoint &>/dev/null
+	    quotacheck -u -g $mountpoint
+	    quotaon $mountpoint
+	    ;;
+	*)
+	    _fail "Don't know how to turn on quota on $FSTYP"
+	    ;;
+	esac
+    fi
+}
+
 _scratch_mount_options()
 {
     _scratch_options mount
@@ -212,6 +238,7 @@ _scratch_mount_options()
 _scratch_mount()
 {
     _mount -t $FSTYP `_scratch_mount_options $*`
+    _setup_quota $SCRATCH_MNT
 }
 
 _scratch_unmount()
@@ -229,6 +256,7 @@ _test_mount()
 {
     _test_options mount
     _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $* $TEST_DEV $TEST_DIR
+    _setup_quota $TEST_DIR
 }
 
 _scratch_mkfs_options()


             reply	other threads:[~2010-02-09 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 19:26 Eric Sandeen [this message]
2010-02-09 22:04 ` [PATCH] xfstests: optionally run all tests under quota Christoph Hellwig
2012-10-26 16:49 ` Rich Johnston
2012-11-05  9:56   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B71B6E7.1000203@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).