resource-agents: master - Fix bind mount handling in fs.sh

Lon Hohberger lon at fedoraproject.org
Tue Dec 15 16:36:07 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=26e9e538b22554d21ae43c4b379b664daf6f05d3
Commit:        26e9e538b22554d21ae43c4b379b664daf6f05d3
Parent:        848e522a760d661e674705ebd7a2a1bc4f7e08c9
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Tue Dec 15 11:28:51 2009 -0500
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Tue Dec 15 11:35:39 2009 -0500

Fix bind mount handling in fs.sh

Don't log warnings for every bind mount found for a
mount point.  Instead, log one warning if and only
if the file system is not mounted in the correct
location.

Resolves: bz526286

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 rgmanager/src/resources/fs.sh.in |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
index 640e7f3..a6238fd 100644
--- a/rgmanager/src/resources/fs.sh.in
+++ b/rgmanager/src/resources/fs.sh.in
@@ -550,6 +550,8 @@ isMounted () {
 	typeset mp tmp_mp
 	typeset dev tmp_dev
 	typeset ret=$FAIL
+	typeset found=1
+	typeset poss_mp
 
 	if [ $# -ne 2 ]; then
 		ocf_log err "Usage: isMounted device mount_point"
@@ -587,14 +589,21 @@ isMounted () {
 			# Check to see if its mounted in the right
 			# place
 			#
-			if [ -n "$tmp_mp"  -a "$tmp_mp"  != "$mp" ]; then
-				ocf_log warn \
-"Device $dev is mounted on $tmp_mp instead of $mp"
+			if [ -n "$tmp_mp" ]; then
+				if [ "$tmp_mp" != "$mp" ]; then
+					poss_mp=$tmp_mp
+				else
+					found=0
+				fi
 			fi
 			ret=$YES
 		fi
 	done < /proc/mounts
 
+	if [ $found -ne 0 ]; then
+		ocf_log warn "Device $dev is mounted on $poss_mp instead of $mp"
+	fi
+
 	return $ret
 }
 


More information about the cluster-commits mailing list