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

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