Fix test whether kernel supports quotas

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>
This commit is contained in:
Jan Kara
2010-05-19 11:25:52 +02:00
parent f73e0fb3f2
commit c9ff0c0447
+5 -4
View File
@@ -27,10 +27,11 @@
_require_quota() _require_quota()
{ {
[ -x /usr/bin/quota ] || _notrun "Quota user tools not installed" [ -x /usr/bin/quota ] || _notrun "Quota user tools not installed"
_scratch_mount "-o usrquota,grpquota" if [ $FSTYP = "xfs" ]; then
ret=$? [ -f /proc/fs/xfs/xqmstat ] || _notrun "Installed kernel does not support XFS quota"
umount $SCRATCH_MNT elif [ $FSTYP != "gfs2" ]; then
[ $ret -ne 0 ] && _notrun "Installed kernel does not support quota" [ -d /proc/sys/fs/quota ] || _notrun "Installed kernel does not support quota"
fi
} }
# #