resource-agents: master - resource-agents: fix incorrect link resolution in fs-lib

Fabio M. Di Nitto fabbione at fedoraproject.org
Tue Jul 6 03:51:20 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=ded66f61ba8967d686dc200eaeadec309bb7c60f
Commit:        ded66f61ba8967d686dc200eaeadec309bb7c60f
Parent:        797a414726d86d4d421c699a3e6f04d4c2000b3c
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Wed Jun 30 12:22:00 2010 -0400
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Tue Jul 6 05:50:19 2010 +0200

resource-agents: fix incorrect link resolution in fs-lib

Fs-lib.sh was not resolving symbolic links prior to
checking [ -b ], meaning that we would end up with
a potential mismatch if what is in /proc/mounts did not
match what was in cluster.conf, causing a service failure

Resolves: rhnz#609579

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

diff --git a/rgmanager/src/resources/utils/fs-lib.sh b/rgmanager/src/resources/utils/fs-lib.sh
index bc3877e..32667ed 100644
--- a/rgmanager/src/resources/utils/fs-lib.sh
+++ b/rgmanager/src/resources/utils/fs-lib.sh
@@ -116,12 +116,6 @@ real_device()
 
 	[ -z "$dev" ] && return $OCF_ERR_ARGS
 
-	# If our provided blockdev is a device, we are done
-	if [ -b "$dev" ]; then
-		REAL_DEVICE="$dev"
-		return $OCF_SUCCESS
-	fi
-
 	# Oops, we have a link.  Sorry, this is going to fork.
 	if [ -h "$dev" ]; then
 		realdev=$(readlink -f $dev)
@@ -132,6 +126,12 @@ real_device()
 		return $OCF_SUCCESS
 	fi
 
+	# If our provided blockdev is a device, we are done
+	if [ -b "$dev" ]; then
+		REAL_DEVICE="$dev"
+		return $OCF_SUCCESS
+	fi
+
 	# It's not a link, it's not a block device.  If it also
 	# does not match UUID= or LABEL=, then findfs is not
 	# going to find anything useful, so we should quit now.


More information about the cluster-commits mailing list