Added checks to ensure group quota is not used before attempting to mount with pquota...
authorAllan Randall <allanr@sgi.com>
Thu, 5 Oct 2006 03:53:10 +0000 (03:53 +0000)
committerAllan Randall <allanr@sgi.com>
Thu, 5 Oct 2006 03:53:10 +0000 (03:53 +0000)
Merge of master-melb:xfs-cmds:27128a by kenmcd.

  Added checks to ensure group quota is not used before attempting to mount with pquota option

134

diff --git a/134 b/134
index 47c1f62488e19794864d1c3b741e03da3953e473..10c16eeb61251e1d5f646b0500641340166805a3 100755 (executable)
--- a/134
+++ b/134
@@ -53,7 +53,13 @@ chmod a+rwx $seq.full        # arbitrary users will write here
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 
-if ! _scratch_mount "-o pquota" >$tmp.out 2>&1
+#if pquota's already in mount options then we dont need to enable
+[ `echo $MOUNT_OPTIONS | grep -c gquota` -eq 0 -a `echo $MOUNT_OPTIONS | grep -c gquota` -eq 0 ] &&\
+    EXTRA_MOUNT_OPTIONS="-o pquota"
+[ `echo $MOUNT_OPTIONS | grep -c gquota` -gt 0 -o `echo $MOUNT_OPTIONS | grep -c gquota` -gt 0 ] &&\
+    _notrun "Can't run with group quotas enabled"
+
+if ! _scratch_mount "$EXTRA_MOUNT_OPTIONS" >$tmp.out 2>&1
 then
     cat $tmp.out
     echo "!!! mount failed"