Blame SOURCES/bz2072371-Filesystem-2-improve-uuid-label-device-logic.patch

d5211c
From d9b46474fc19d9c57e2cfb752d60319017da8410 Mon Sep 17 00:00:00 2001
d5211c
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
d5211c
Date: Wed, 6 Apr 2022 14:14:19 +0200
d5211c
Subject: [PATCH] Filesystem: improve logic for UUID/label and add note that
d5211c
 /dev/disk/by-{uuid,label}/ are preferred on Linux
d5211c
d5211c
---
d5211c
 heartbeat/Filesystem | 8 +++++---
d5211c
 1 file changed, 5 insertions(+), 3 deletions(-)
d5211c
d5211c
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
d5211c
index 72a1b8623..44270ad98 100755
d5211c
--- a/heartbeat/Filesystem
d5211c
+++ b/heartbeat/Filesystem
d5211c
@@ -163,6 +163,8 @@ directory where the status file is to be placed.
d5211c
 <parameter name="device" required="1">
d5211c
 <longdesc lang="en">
d5211c
 The name of block device for the filesystem, or -U, -L options for mount, or NFS mount specification.
d5211c
+
d5211c
+NOTE: On Linux /dev/disk/by-{uuid,label}/ are preferred to -U/-L.
d5211c
 </longdesc>
d5211c
 <shortdesc lang="en">block device</shortdesc>
d5211c
 <content type="string" default="${OCF_RESKEY_device_default}" />
d5211c
@@ -902,11 +904,11 @@ set_blockdevice_var() {
d5211c
 	fi
d5211c
 
d5211c
 	case "$DEVICE" in
d5211c
-	--*) # Typically --uuid or --label
d5211c
-		device_opt=$(echo $DEVICE | sed -E "s/([[:blank:]]|=).*//")
d5211c
+	--uuid=*|--uuid\ *|--label=*|--label\ *)
d5211c
+		device_opt=$(echo $DEVICE | sed "s/\([[:blank:]]\|=\).*//")
d5211c
 		DEVICE=$(echo $DEVICE | sed -E "s/$device_opt([[:blank:]]*|=)//")
d5211c
 		;;
d5211c
-	-*)  # Oh... An option to mount instead...  Typically -U or -L
d5211c
+	-U*|-L*)  # short versions of --uuid/--label
d5211c
 		device_opt=$(echo $DEVICE | cut -c1-2)
d5211c
 		DEVICE=$(echo $DEVICE | sed "s/$device_opt[[:blank:]]*//")
d5211c
 		;;