]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
Fix test whether kernel supports quotas
authorJan Kara <jack@suse.cz>
Wed, 19 May 2010 09:25:52 +0000 (11:25 +0200)
committerJan Kara <jack@suse.cz>
Thu, 20 May 2010 17:06:15 +0000 (19:06 +0200)
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

index 51bdc71bfd148f9343ba66b32b414d241d478061..d32e285bdc46c100d978376bc38c3f1edd326fa7 100644 (file)
 _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
 }
 
 #