resource-agents/SOURCES/bz1777381-Filesystem-1-refresh-UUID.patch
2021-09-10 03:52:59 +00:00

34 lines
1.2 KiB
Diff

From 18888da3ceef7a56388c89a616485fd8faa392cc Mon Sep 17 00:00:00 2001
From: Roger Zhou <zzhou@suse.com>
Date: Thu, 14 Nov 2019 17:52:13 +0800
Subject: [PATCH] Filesystem: refresh UUID in the start phase
In the case a fresh filesystem is just created from another node on the
shared storage, is not visible yet. Then try partprobe to refresh
/dev/disk/by-uuid/* up to date.
Signed-off-by: Roger Zhou <zzhou@suse.com>
---
heartbeat/Filesystem | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
index e66ddc77f..543986441 100755
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -454,6 +454,14 @@ Filesystem_start()
# accordingly
if [ $blockdevice = "yes" ]; then
+ if [ "$DEVICE" != "/dev/null" -a ! -b "$DEVICE" ] ; then
+ # In the case a fresh filesystem is just created
+ # from another node on the shared storage, and
+ # is not visible yet. Then try partprobe to
+ # refresh /dev/disk/by-uuid/* up to date.
+ have_binary partprobe && partprobe >/dev/null 2>&1
+ fi
+
if [ "$DEVICE" != "/dev/null" -a ! -b "$DEVICE" ] ; then
ocf_exit_reason "Couldn't find device [$DEVICE]. Expected /dev/??? to exist"
exit $OCF_ERR_INSTALLED