Blame SOURCES/bz1624203-Filesystem-2-add-symlink-support.patch

5c52dd
From e2c3ec91cdd123b8afc6010f45ecd22ee6d8ecf7 Mon Sep 17 00:00:00 2001
5c52dd
From: Reid Wahl <nwahl@redhat.com>
5c52dd
Date: Mon, 3 Sep 2018 00:30:01 -0700
5c52dd
Subject: [PATCH] Filesystem: Canonicalize mountpoint symlinks
5c52dd
5c52dd
Commit 2aa8015 added support to `Filesystem_status()` for mountpoints
5c52dd
that are symlinks. However, it missed two other places where `readlink`
5c52dd
calls should have been added to canonicalize symlinks.
5c52dd
---
5c52dd
 heartbeat/Filesystem | 6 +++---
5c52dd
 1 file changed, 3 insertions(+), 3 deletions(-)
5c52dd
5c52dd
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
5c52dd
index fc4b8fcd5..2a43d1daa 100755
5c52dd
--- a/heartbeat/Filesystem
5c52dd
+++ b/heartbeat/Filesystem
5c52dd
@@ -278,7 +278,7 @@ determine_blockdevice() {
5c52dd
 	nfs4|nfs|smbfs|cifs|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|none)
5c52dd
 		: ;;
5c52dd
 	*)
5c52dd
-		DEVICE=`list_mounts | grep " $MOUNTPOINT " | cut -d' ' -f1`
5c52dd
+		DEVICE=`list_mounts | grep " $(readlink -f "$MOUNTPOINT" ) " | cut -d' ' -f1`
5c52dd
 		if [ -b "$DEVICE" ]; then
5c52dd
 			blockdevice=yes
5c52dd
 		fi
5c52dd
@@ -396,7 +396,7 @@ fstype_supported()
5c52dd
 Filesystem_start()
5c52dd
 {
5c52dd
 	# Check if there are any mounts mounted under the mountpoint
5c52dd
-	if list_mounts | grep -q -E " $MOUNTPOINT/\w+" >/dev/null 2>&1; then
5c52dd
+	if list_mounts | grep -q -E " $(readlink -f "$MOUNTPOINT" )/\w+" >/dev/null 2>&1; then
5c52dd
 		ocf_log err "There is one or more mounts mounted under $MOUNTPOINT."
5c52dd
 		return $OCF_ERR_CONFIGURED
5c52dd
 	fi
5c52dd
@@ -580,7 +580,7 @@ Filesystem_stop()
5c52dd
 #
5c52dd
 Filesystem_status()
5c52dd
 {
5c52dd
-	if list_mounts | grep -q " $(readlink -f $MOUNTPOINT) " >/dev/null 2>&1; then
5c52dd
+	if list_mounts | grep -q " $(readlink -f "$MOUNTPOINT" ) " >/dev/null 2>&1; then
5c52dd
 		rc=$OCF_SUCCESS
5c52dd
 		msg="$MOUNTPOINT is mounted (running)"
5c52dd
 	else