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

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