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

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