From 3951402859114714d966121bc29fd4f183791160 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Thu, 21 Apr 2022 14:50:36 +0200 Subject: [PATCH] - Filesystem: fix UUID/label device support when there's whitespace between parameter and UUID/label Resolves: rhbz#2072371 --- ...m-1-fix-uuid-label-device-whitespace.patch | 44 +++++++++++++++++++ ...em-2-improve-uuid-label-device-logic.patch | 38 ++++++++++++++++ resource-agents.spec | 12 ++++- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 bz2072371-Filesystem-1-fix-uuid-label-device-whitespace.patch create mode 100644 bz2072371-Filesystem-2-improve-uuid-label-device-logic.patch diff --git a/bz2072371-Filesystem-1-fix-uuid-label-device-whitespace.patch b/bz2072371-Filesystem-1-fix-uuid-label-device-whitespace.patch new file mode 100644 index 0000000..09960f0 --- /dev/null +++ b/bz2072371-Filesystem-1-fix-uuid-label-device-whitespace.patch @@ -0,0 +1,44 @@ +From 26de0ad2f0f975166fe79ef72ab08e2c03519eea Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Mon, 28 Mar 2022 13:25:35 +0200 +Subject: [PATCH] Filesystem: fix logic for UUID/label devices with space + between parameter and UUID/label + +--- + heartbeat/Filesystem | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 1a90d6a42..72a1b8623 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -596,11 +596,11 @@ Filesystem_start() + flushbufs "$DEVICE" + # Mount the filesystem. + case "$FSTYPE" in +- none) $MOUNT $options "$DEVICE" "$MOUNTPOINT" && ++ none) $MOUNT $options $device_opt "$DEVICE" "$MOUNTPOINT" && + bind_mount + ;; +- "") $MOUNT $options "$DEVICE" "$MOUNTPOINT" ;; +- *) $MOUNT -t "$FSTYPE" $options "$DEVICE" "$MOUNTPOINT" ;; ++ "") $MOUNT $options $device_opt "$DEVICE" "$MOUNTPOINT" ;; ++ *) $MOUNT -t "$FSTYPE" $options $device_opt "$DEVICE" "$MOUNTPOINT" ;; + esac + + if [ $? -ne 0 ]; then +@@ -902,7 +902,13 @@ set_blockdevice_var() { + fi + + case "$DEVICE" in +- -*) # Oh... An option to mount instead... Typically -U or -L ++ --*) # Typically --uuid or --label ++ device_opt=$(echo $DEVICE | sed -E "s/([[:blank:]]|=).*//") ++ DEVICE=$(echo $DEVICE | sed -E "s/$device_opt([[:blank:]]*|=)//") ++ ;; ++ -*) # Oh... An option to mount instead... Typically -U or -L ++ device_opt=$(echo $DEVICE | cut -c1-2) ++ DEVICE=$(echo $DEVICE | sed "s/$device_opt[[:blank:]]*//") + ;; + /dev/null) # Special case for BSC + blockdevice=yes diff --git a/bz2072371-Filesystem-2-improve-uuid-label-device-logic.patch b/bz2072371-Filesystem-2-improve-uuid-label-device-logic.patch new file mode 100644 index 0000000..844772a --- /dev/null +++ b/bz2072371-Filesystem-2-improve-uuid-label-device-logic.patch @@ -0,0 +1,38 @@ +From d9b46474fc19d9c57e2cfb752d60319017da8410 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 6 Apr 2022 14:14:19 +0200 +Subject: [PATCH] Filesystem: improve logic for UUID/label and add note that + /dev/disk/by-{uuid,label}/ are preferred on Linux + +--- + heartbeat/Filesystem | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 72a1b8623..44270ad98 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -163,6 +163,8 @@ directory where the status file is to be placed. + + + The name of block device for the filesystem, or -U, -L options for mount, or NFS mount specification. ++ ++NOTE: On Linux /dev/disk/by-{uuid,label}/ are preferred to -U/-L. + + block device + +@@ -902,11 +904,11 @@ set_blockdevice_var() { + fi + + case "$DEVICE" in +- --*) # Typically --uuid or --label +- device_opt=$(echo $DEVICE | sed -E "s/([[:blank:]]|=).*//") ++ --uuid=*|--uuid\ *|--label=*|--label\ *) ++ device_opt=$(echo $DEVICE | sed "s/\([[:blank:]]\|=\).*//") + DEVICE=$(echo $DEVICE | sed -E "s/$device_opt([[:blank:]]*|=)//") + ;; +- -*) # Oh... An option to mount instead... Typically -U or -L ++ -U*|-L*) # short versions of --uuid/--label + device_opt=$(echo $DEVICE | cut -c1-2) + DEVICE=$(echo $DEVICE | sed "s/$device_opt[[:blank:]]*//") + ;; diff --git a/resource-agents.spec b/resource-agents.spec index c4dfe79..e34ba80 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.10.0 -Release: 11%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 12%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -64,6 +64,8 @@ Patch11: bz2055016-4-IPsrcaddr-fixes.patch Patch12: bz2069270-corosync-qnetd-new-ra.patch Patch13: bz2065125-LVM-activate-fix-fence-issue.patch Patch14: bz2065138-IPaddr2-enable-more-control-for-IPv6-addresses.patch +Patch15: bz2072371-Filesystem-1-fix-uuid-label-device-whitespace.patch +Patch16: bz2072371-Filesystem-2-improve-uuid-label-device-logic.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aws.patch @@ -202,6 +204,8 @@ exit 1 %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 +%patch16 -p1 # bundled ha-cloud-support libs %patch500 -p1 @@ -531,6 +535,12 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Thu Apr 21 2022 Oyvind Albrigtsen - 4.10.0-12 +- Filesystem: fix UUID/label device support when there's whitespace + between parameter and UUID/label + + Resolves: rhbz#2072371 + * Tue Apr 5 2022 Oyvind Albrigtsen - 4.10.0-11 - LVM-activate: use correct return code to fence failed node - IPaddr2: enable more control for IPv6 addresses