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.

Closes-Bug: 1920245
Signed-off-by: David Sullivan <david.sullivan@windriver.com>
Change-Id: Ic1b4583c72a0dd256724b8672dbb59126273330b
This commit is contained in:
David Sullivan 2021-04-20 17:32:45 -05:00
parent 95cf70edfb
commit e62b1a53b9
2 changed files with 30 additions and 0 deletions

View File

@ -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 \

View File

@ -0,0 +1,28 @@
From 46962e144b850b6a1dca449f0ee623c8e85596d2 Mon Sep 17 00:00:00 2001
From: David Sullivan <david.sullivan@windriver.com>
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