From 025c9f7ec8565d4ff705f49a280808295bed472b Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Tue, 22 Apr 2025 16:12:41 +0200 Subject: [PATCH] - Filesystem: add support for aznfs Resolves: RHEL-88035 --- ...035-Filesystem-add-support-for-aznfs.patch | 171 ++++++++++++++++++ resource-agents.spec | 9 +- 2 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 RHEL-88035-Filesystem-add-support-for-aznfs.patch diff --git a/RHEL-88035-Filesystem-add-support-for-aznfs.patch b/RHEL-88035-Filesystem-add-support-for-aznfs.patch new file mode 100644 index 0000000..65466e4 --- /dev/null +++ b/RHEL-88035-Filesystem-add-support-for-aznfs.patch @@ -0,0 +1,171 @@ +From 3bffa541f7bf66e143f14e51551fc91dfebec86c Mon Sep 17 00:00:00 2001 +From: Tobias Schug +Date: Mon, 28 Oct 2024 09:14:41 +0100 +Subject: [PATCH] Add azure aznfs filesystem support + +--- + heartbeat/Filesystem | 37 ++++++++++++++++++++----------------- + 1 file changed, 20 insertions(+), 17 deletions(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 3405e2c26..b48bee142 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -2,7 +2,7 @@ + # + # Support: users@clusterlabs.org + # License: GNU General Public License (GPL) +-# ++# + # Filesystem + # Description: Manages a Filesystem on a shared storage medium. + # Original Author: Eric Z. Ayers (eric.ayers@compgen.com) +@@ -142,7 +142,7 @@ meta_data() { + + + Resource script for Filesystem. It manages a Filesystem on a +-shared storage medium. ++shared storage medium. + + The standard monitor operation of depth 0 (also known as probe) + checks if the filesystem is mounted. If you want deeper tests, +@@ -260,7 +260,7 @@ currently accessing the mount directory. + "true" : Kill processes accessing mount point + "safe" : Kill processes accessing mount point using methods that + avoid functions that could potentially block during process +- detection ++ detection + "false" : Do not kill any processes. + + The 'safe' option uses shell logic to walk the /procs/ directory +@@ -373,7 +373,7 @@ determine_blockdevice() { + # Get the current real device name, if possible. + # (specified devname could be -L or -U...) + case "$FSTYPE" in +- nfs4|nfs|efs|smbfs|cifs|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|none|lustre) ++ nfs4|nfs|aznfs|efs|smbfs|cifs|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|none|lustre) + : ;; + *) + match_string="${TAB}${CANONICALIZED_MOUNTPOINT}${TAB}" +@@ -455,7 +455,7 @@ is_fsck_needed() { + no) false;; + ""|auto) + case "$FSTYPE" in +- ext4|ext4dev|ext3|reiserfs|reiser4|nss|xfs|jfs|vfat|fat|nfs4|nfs|efs|cifs|smbfs|ocfs2|gfs2|none|lustre|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs) ++ ext4|ext4dev|ext3|reiserfs|reiser4|nss|xfs|jfs|vfat|fat|nfs4|nfs|aznfs|efs|cifs|smbfs|ocfs2|gfs2|none|lustre|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs) + false;; + *) + true;; +@@ -478,7 +478,7 @@ fstype_supported() + fi + + if [ -z "$FSTYPE" -o "$FSTYPE" = none ]; then +- : No FSTYPE specified, rely on the system has the right file-system support already ++ : No FSTYPE specified, rely on the system has the right file-system support already + return $OCF_SUCCESS + fi + +@@ -487,6 +487,7 @@ fstype_supported() + case "$FSTYPE" in + fuse.*|glusterfs|rozofs) support="fuse";; + efs) check_binary "mount.efs"; support="nfs4";; ++ aznfs) check_binary "mount.aznfs"; support="nfs4";; + esac + + if [ "$support" != "$FSTYPE" ]; then +@@ -530,7 +531,7 @@ fstype_supported() + # node on the shared storage, and is not visible yet. Then try + # partprobe to refresh /dev/disk/by-{label,uuid}/* up to date. + # +-# DEVICE can be /dev/xxx, -U, -L ++# DEVICE can be /dev/xxx, -U, -L + # + trigger_udev_rules_if_needed() + { +@@ -545,12 +546,12 @@ trigger_udev_rules_if_needed() + fi + else + tmp="$(echo $DEVICE|awk '{$1=""; print substr($0,2)}')" +- case "$DEVICE" in +- -U*|--uuid*) +- tmp="/dev/disk/by-uuid/$tmp" ++ case "$DEVICE" in ++ -U*|--uuid*) ++ tmp="/dev/disk/by-uuid/$tmp" + ;; + -L*|--label*) +- tmp="/dev/disk/by-label/$tmp" ++ tmp="/dev/disk/by-label/$tmp" + ;; + *) + # bind mount? +@@ -595,7 +596,7 @@ Filesystem_start() + + fstype_supported || exit $OCF_ERR_INSTALLED + +- # Check the filesystem & auto repair. ++ # Check the filesystem & auto repair. + # NOTE: Some filesystem types don't need this step... Please modify + # accordingly + +@@ -697,7 +698,7 @@ signal_processes() { + local sig=$2 + local pids pid + # fuser returns a non-zero return code if none of the +- # specified files is accessed or in case of a fatal ++ # specified files is accessed or in case of a fatal + # error. + pids=$(get_pids "$dir") + if [ -z "$pids" ]; then +@@ -745,6 +746,7 @@ fs_stop_loop() { + try_umount "$force_arg" "$SUB" && return $OCF_SUCCESS + done + } ++ + fs_stop() { + local SUB="$1" timeout=$2 grace_time ret + grace_time=$((timeout/2)) +@@ -797,7 +799,7 @@ Filesystem_stop() + + # For networked filesystems, there's merit in trying -f: + case "$FSTYPE" in +- nfs4|nfs|efs|cifs|smbfs) umount_force="-f" ;; ++ nfs4|nfs|aznfs|efs|cifs|smbfs) umount_force="-f" ;; + esac + + # Umount all sub-filesystems mounted under $MOUNTPOINT/ too. +@@ -942,6 +944,7 @@ Filesystem_monitor_20() + fi + return $OCF_SUCCESS + } ++ + Filesystem_monitor() + { + Filesystem_status +@@ -1016,7 +1019,7 @@ set_blockdevice_var() { + + # these are definitely not block devices + case "$FSTYPE" in +- nfs4|nfs|efs|smbfs|cifs|none|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|lustre) return;; ++ nfs4|nfs|aznfs|efs|smbfs|cifs|none|glusterfs|ceph|tmpfs|overlay|overlayfs|rozofs|zfs|cvfs|lustre) return;; + esac + + if $(is_option "loop"); then +@@ -1098,7 +1101,7 @@ set_blockdevice_var + if [ -z "$OCF_RESKEY_directory" ]; then + if [ X$OP = "Xstart" -o $blockdevice = "no" ]; then + ocf_exit_reason "Please specify the directory" +- exit $OCF_ERR_CONFIGURED ++ exit $OCF_ERR_CONFIGURED + fi + else + MOUNTPOINT="$(echo "$OCF_RESKEY_directory" | sed 's/\/*$//')" +@@ -1166,7 +1169,7 @@ is_option "ro" && + CLUSTERSAFE=2 + + case "$FSTYPE" in +-nfs4|nfs|efs|smbfs|cifs|none|gfs2|glusterfs|ceph|ocfs2|overlay|overlayfs|tmpfs|cvfs|lustre) ++nfs4|nfs|aznfs|efs|smbfs|cifs|none|gfs2|glusterfs|ceph|ocfs2|overlay|overlayfs|tmpfs|cvfs|lustre) + CLUSTERSAFE=1 # this is kind of safe too + systemd_drop_in "99-Filesystem-remote" "After" "remote-fs.target" + ;; diff --git a/resource-agents.spec b/resource-agents.spec index 2b5b612..dbdc022 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: 73%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 74%{?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 @@ -155,6 +155,7 @@ Patch102: RHEL-76038-3-storage-mon-only-use-underscores-in-functions.patch Patch103: RHEL-76038-4-storage-mon-check-if-daemon-is-already-running.patch Patch104: RHEL-76038-5-storage-mon-log-storage_mon-is-already-running-in-start-action.patch Patch105: RHEL-79819-portblock-fix-version-detection.patch +Patch106: RHEL-88035-Filesystem-add-support-for-aznfs.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aliyun.patch @@ -384,6 +385,7 @@ exit 1 %patch -p1 -P 103 %patch -p1 -P 104 %patch -p1 -P 105 +%patch -p1 -P 106 # bundled ha-cloud-support libs %patch -p1 -P 500 @@ -713,6 +715,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Tue Apr 22 2025 Oyvind Albrigtsen - 4.10.0-74 +- Filesystem: add support for aznfs + + Resolves: RHEL-88035 + * Wed Apr 9 2025 Oyvind Albrigtsen - 4.10.0-73 - storage-mon: fix daemon mode bug that caused delayed initial score - portblock: fix iptables version detection