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

Lon Hohberger lon at fedoraproject.org
Wed Jun 30 16:27:57 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=56e843fbbce29a4e821f32ebcd271ac0455a4203
Commit:        56e843fbbce29a4e821f32ebcd271ac0455a4203
Parent:        1f423c3a2d0de6960955fe17dcc5f61f3a709016
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Wed Jun 30 12:22:00 2010 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Wed Jun 30 12:22:00 2010 -0400

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