Blame SOURCES/bz1387363-Filesystem-submount-check.patch

15862b
diff -uNr a/heartbeat/Filesystem b/heartbeat/Filesystem
15862b
--- a/heartbeat/Filesystem	2016-12-20 14:16:29.439700386 +0100
15862b
+++ b/heartbeat/Filesystem	2016-12-20 14:18:04.954623779 +0100
15862b
@@ -538,6 +538,12 @@
15862b
 		Filesystem_notify
15862b
 	fi
15862b
 
15862b
+	# Check if there are any mounts mounted under the mountpoint
15862b
+	if list_mounts | grep -q -E " $MOUNTPOINT/\w+" >/dev/null 2>&1; then
15862b
+		ocf_log err "There is one or more mounts mounted under $MOUNTPOINT."
15862b
+		return $OCF_ERR_CONFIGURED
15862b
+	fi
15862b
+
15862b
 	# See if the device is already mounted.
15862b
 	if Filesystem_status >/dev/null 2>&1 ; then
15862b
 		ocf_log info "Filesystem $MOUNTPOINT is already mounted."