xfs
[Top] [All Lists]

[PATCH 3/4] xfstests: fix quota detection

To: xfs@xxxxxxxxxxx
Subject: [PATCH 3/4] xfstests: fix quota detection
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 15 Oct 2010 18:29:13 -0400
In-reply-to: <20101015222820.GA3655@xxxxxxxxxxxxx>
References: <20101015222820.GA3655@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-08-17)
Even if the kernel has quota support built in most filesystems still
don't support it.  As there's no good way to find out if a filesystem
supports quotas hardcode the list of filesystems that do support
quotas.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfstests-dev/common.quota
===================================================================
--- xfstests-dev.orig/common.quota      2010-10-14 19:28:41.000000000 +0000
+++ xfstests-dev/common.quota   2010-10-14 19:33:45.000000000 +0000
@@ -27,11 +27,24 @@
 _require_quota()
 {
     [ -n $QUOTA_PROG ] || _notrun "Quota user tools not installed"
-    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
+
+    case $FSTYP in
+    ext2|ext3|ext4|reiserfs)
+       if [ ! -d /proc/sys/fs/quota ]; then
+           _notrun "Installed kernel does not support quotas"
+       fi
+       ;;
+    gfs2)
+       ;;
+    xfs)
+       if [ ! -f /proc/fs/xfs/xqmstat ]; then
+           _notrun "Installed kernel does not support XFS quotas"
+        fi
+       ;;
+    *)
+       _notrun "disk quotas not supported by this filesystem type: $FSTYP"
+       ;;
+    esac
 }
 
 #

<Prev in Thread] Current Thread [Next in Thread>