diff --git a/filesystem/drbd/drbd-tools/centos/drbd.spec b/filesystem/drbd/drbd-tools/centos/drbd.spec index 443193402..a021b11d0 100644 --- a/filesystem/drbd/drbd-tools/centos/drbd.spec +++ b/filesystem/drbd/drbd-tools/centos/drbd.spec @@ -45,6 +45,7 @@ Patch0007: 0007-Update-OCF-to-attempt-connect-in-certain-states.patch Patch0008: 0008-Increase-short-cmd-timeout-to-15-secs.patch Patch0009: 0009-Check-for-mounted-device-before-demoting-Primary-DRB.patch Patch0010: 0010-backport-drbd-main-ipv6-Fix-interface-indices-larger.patch +Patch0011: 0011-Unmount-all-targets-during-drbd-stop.patch License: GPLv2+ ExclusiveOS: linux @@ -275,6 +276,7 @@ management utility. %patch0008 -p1 %patch0009 -p1 %patch0010 -p1 +%patch0011 -p1 %build %configure \ diff --git a/filesystem/drbd/drbd-tools/centos/patches/0011-Unmount-all-targets-during-drbd-stop.patch b/filesystem/drbd/drbd-tools/centos/patches/0011-Unmount-all-targets-during-drbd-stop.patch new file mode 100644 index 000000000..269d1623b --- /dev/null +++ b/filesystem/drbd/drbd-tools/centos/patches/0011-Unmount-all-targets-during-drbd-stop.patch @@ -0,0 +1,28 @@ +From 46962e144b850b6a1dca449f0ee623c8e85596d2 Mon Sep 17 00:00:00 2001 +From: David Sullivan +Date: Tue, 20 Apr 2021 13:22:19 -0500 +Subject: [PATCH] Unmount all targets during drbd stop + +When stopping drbd, we need to unmount targets from each device. Devices +with multiple mountpoints can fail to unmount, leading to metadata +corruption. Add --all-targets to the umount command. +--- + scripts/drbd | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/drbd b/scripts/drbd +index 3c7f8a5..eca4e3b 100755 +--- a/scripts/drbd ++++ b/scripts/drbd +@@ -182,7 +182,7 @@ case "$1" in + for d in /dev/drbd* ; do + [ -L "$d" ] && continue + [ -b "$d" ] || continue +- M=$(umount "$d" 2>&1) ++ M=$(umount --all-targets "$d" 2>&1) + case $M in + *" not mounted") :;; + *) echo "$M" >&2 ;; +-- +2.24.1 +