Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 282661ac02c11d5b3e93f8cc033f975011fd7935
Parent: f69006f7654e9f45da64ccb8b4b823b0ce2f4cc4
Author: Ryan Mitchell <rmitchel(a)redhat.com>
AuthorDate: Thu Apr 7 09:55:36 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon May 2 12:41:44 2011 -0400
rgmanager: Fix quotaoff handling
This is a simple port from the RHEL4 branch performed by
Ryan Mitchell.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Resolves: rhbz#694731
---
rgmanager/src/resources/fs.sh | 49 ++++++++++++++++++++++++++++++-----------
1 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index ce3e983..49912c2 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -699,19 +699,11 @@ isAlive()
# Decide which quota options are enabled and return a string
# which we can pass to quotaon
#
-enable_fs_quotas()
+quota_opts()
{
- declare -i need_check=0
- declare -i rv
declare quotaopts=""
- declare mopt
declare opts=$1
- declare mp=$2
-
- if [ -z "`which quotaon`" ]; then
- ocf_log err "quotaon not found in $PATH"
- return $OCF_ERR_GENERIC
- fi
+ declare mopt
for mopt in `echo $opts | sed -e s/,/\ /g`; do
case $mopt in
@@ -730,6 +722,33 @@ enable_fs_quotas()
esac
done
+ echo $quotaopts
+ return 0
+}
+
+
+
+#
+# Enable quotas on the mount point if the user requested them
+#
+enable_fs_quotas()
+{
+ declare -i need_check=0
+ declare -i rv
+ declare quotaopts=""
+ declare mopt
+ declare opts=$1
+ declare mp=$2
+
+ if [ -z "`which quotaon`" ]; then
+ ocf_log err "quotaon not found in $PATH"
+ return $OCF_ERR_GENERIC
+ fi
+
+ quotaopts=$(quota_opts $opts)
+
+ ocf_log info "quotaopts = $quotaopts"
+
[ -z "$quotaopts" ] && return 0
# Ok, create quota files if they don't exist
@@ -991,6 +1010,7 @@ stopFilesystem() {
typeset force_umount=""
typeset self_fence=""
typeset fstype=""
+ typeset quotaopts=""
#
@@ -1057,10 +1077,13 @@ stop: Could not match $OCF_RESKEY_device with a real device"
;;
$YES)
sync; sync; sync
- ocf_log info "unmounting $mp"
-
+ quotaopts=$(quota_opts $OCF_RESKEY_options)
+ if [ -n "$quotaopts" ]; then
+ ocf_log debug "Turning off quotas for $mp"
+ quotaoff -$quotaopts $mp &> /dev/null
+ fi
- quotaoff -gu $mp &> /dev/null
+ ocf_log info "unmounting $mp"
umount $mp
if [ $? -eq 0 ]; then
umount_failed=