From c9ff0c04476af68c93a120bb6f16c2a0182788ea Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 19 May 2010 11:25:52 +0200 Subject: [PATCH] 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 --- common.quota | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common.quota b/common.quota index 51bdc71b..d32e285b 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 } # -- 2.47.3