diff --git a/0012-mdcheck-when-mdcheck_start-is-enabled-enable-mdcheck.patch b/0012-mdcheck-when-mdcheck_start-is-enabled-enable-mdcheck.patch new file mode 100644 index 0000000..269c27a --- /dev/null +++ b/0012-mdcheck-when-mdcheck_start-is-enabled-enable-mdcheck.patch @@ -0,0 +1,44 @@ +From 751090e03c584ae2e4badd8823bd68d8d0c4c298 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Fri, 18 Oct 2019 11:10:34 +1100 +Subject: [PATCH] mdcheck: when mdcheck_start is enabled, enable + mdcheck_continue too. + +mdcheck_continue continues a regular array scan that was started by +mdcheck_start. +mdcheck_start will ensure that mdcheck_continue is active. +Howver if you reboot after a check has started, but before it finishes, +then mdcheck_continue won't cause it to continue, because nothing +starts it on boot. + +So add an install option for mdcheck_contine, and make sure it +gets enabled when mdcheck_start is enabled. + +Signed-off-by: NeilBrown +--- + systemd/mdcheck_continue.timer | 2 ++ + systemd/mdcheck_start.timer | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/systemd/mdcheck_continue.timer b/systemd/mdcheck_continue.timer +index 3ccfd7858a3f..dba1074c1f44 100644 +--- a/systemd/mdcheck_continue.timer ++++ b/systemd/mdcheck_continue.timer +@@ -11,3 +11,5 @@ Description=MD array scrubbing - continuation + [Timer] + OnCalendar= 1:05:00 + ++[Install] ++WantedBy= mdmonitor.service +diff --git a/systemd/mdcheck_start.timer b/systemd/mdcheck_start.timer +index 64807362d649..9e7e02ab7333 100644 +--- a/systemd/mdcheck_start.timer ++++ b/systemd/mdcheck_start.timer +@@ -13,3 +13,4 @@ OnCalendar=Sun *-*-1..7 1:00:00 + + [Install] + WantedBy= mdmonitor.service ++Also= mdcheck_continue.timer +-- +2.23.0 + diff --git a/0013-mdcheck-use-to-pass-variable-to-mdcheck.patch b/0013-mdcheck-use-to-pass-variable-to-mdcheck.patch new file mode 100644 index 0000000..d79423e --- /dev/null +++ b/0013-mdcheck-use-to-pass-variable-to-mdcheck.patch @@ -0,0 +1,50 @@ +From fde9606a9780cf2701fa903eeb528b9f4400282e Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Wed, 30 Oct 2019 09:25:00 +1100 +Subject: [PATCH] mdcheck: use ${} to pass variable to mdcheck + +$MDADM_CHECK_DURATION allows the value to be split on spaces. +${MDADM_CHECK_DURATION} avoids such splitting. + +Making this change removes the need for double quoting when setting +the default Environment, and means that double quoting isn't needed +in the EnvironmentFile. + +Signed-off-by: NeilBrown +--- + systemd/mdcheck_continue.service | 5 ++--- + systemd/mdcheck_start.service | 4 ++-- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/systemd/mdcheck_continue.service b/systemd/mdcheck_continue.service +index 592c60798f82..deac695485b0 100644 +--- a/systemd/mdcheck_continue.service ++++ b/systemd/mdcheck_continue.service +@@ -11,8 +11,7 @@ ConditionPathExistsGlob = /var/lib/mdcheck/MD_UUID_* + + [Service] + Type=oneshot +-Environment= MDADM_CHECK_DURATION='"6 hours"' ++Environment= MDADM_CHECK_DURATION="6 hours" + EnvironmentFile=-/run/sysconfig/mdadm + ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh +-ExecStart=/usr/share/mdadm/mdcheck --continue --duration $MDADM_CHECK_DURATION +- ++ExecStart=/usr/share/mdadm/mdcheck --continue --duration ${MDADM_CHECK_DURATION} +diff --git a/systemd/mdcheck_start.service b/systemd/mdcheck_start.service +index 812141bb5c9a..f17f1aaec217 100644 +--- a/systemd/mdcheck_start.service ++++ b/systemd/mdcheck_start.service +@@ -11,7 +11,7 @@ Wants=mdcheck_continue.timer + + [Service] + Type=oneshot +-Environment= MDADM_CHECK_DURATION='"6 hours"' ++Environment= MDADM_CHECK_DURATION="6 hours" + EnvironmentFile=-/run/sysconfig/mdadm + ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh +-ExecStart=/usr/share/mdadm/mdcheck --duration $MDADM_CHECK_DURATION ++ExecStart=/usr/share/mdadm/mdcheck --duration ${MDADM_CHECK_DURATION} +-- +2.23.0 + diff --git a/0014-SUSE-mdadm_env.sh-handle-MDADM_CHECK_DURATION.patch b/0014-SUSE-mdadm_env.sh-handle-MDADM_CHECK_DURATION.patch new file mode 100644 index 0000000..ca846c6 --- /dev/null +++ b/0014-SUSE-mdadm_env.sh-handle-MDADM_CHECK_DURATION.patch @@ -0,0 +1,27 @@ +From e76aa254a99cca27715d65aa5188c9b47b1c4f8e Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Wed, 30 Oct 2019 09:27:34 +1100 +Subject: [PATCH] SUSE-mdadm_env.sh: handle MDADM_CHECK_DURATION + +The suse sysconfig/mdadm allows MDADM_CHECK_DURATION +to be set, but it is currently ignored. + +Signed-off-by: NeilBrown +--- + systemd/SUSE-mdadm_env.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/systemd/SUSE-mdadm_env.sh b/systemd/SUSE-mdadm_env.sh +index 10b2e749921c..c13b48ab3cb1 100644 +--- a/systemd/SUSE-mdadm_env.sh ++++ b/systemd/SUSE-mdadm_env.sh +@@ -43,3 +43,6 @@ fi + + mkdir -p /run/sysconfig + echo "MDADM_MONITOR_ARGS=$MDADM_RAIDDEVICES $MDADM_DELAY $MDADM_MAIL $MDADM_PROGRAM $MDADM_SCAN $MDADM_SEND_MAIL $MDADM_CONFIG" > /run/sysconfig/mdadm ++if [ -n "$MDADM_CHECK_DURATION" ]; then ++ echo "MDADM_CHECK_DURATION=$MDADM_CHECK_DURATION" >> /run/sysconfig/mdadm ++fi +-- +2.23.0 + diff --git a/mdadm.changes b/mdadm.changes index 6cafc94..bc7ce58 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Oct 30 00:10:38 UTC 2019 - Neil Brown + +- 0012-mdcheck-when-mdcheck_start-is-enabled-enable-mdcheck.patch + 0013-mdcheck-use-to-pass-variable-to-mdcheck.patch + 0014-SUSE-mdadm_env.sh-handle-MDADM_CHECK_DURATION.patch + Improve mdcheck (bsc#1153258) + ------------------------------------------------------------------- Thu Mar 28 11:43:38 UTC 2019 - colyli@suse.com diff --git a/mdadm.spec b/mdadm.spec index 5a89926..9dca942 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -53,6 +53,9 @@ Patch18: 0008-policy.c-prevent-NULL-pointer-referencing.patch Patch19: 0009-Detail.c-do-not-skip-first-character-when-calling-xs.patch Patch20: 0010-imsm-finish-recovery-when-drive-with-rebuild-fails.patch Patch21: 0011-mdmon-don-t-attempt-to-manage-new-arrays-when-termin.patch +Patch22: 0012-mdcheck-when-mdcheck_start-is-enabled-enable-mdcheck.patch +Patch23: 0013-mdcheck-use-to-pass-variable-to-mdcheck.patch +Patch24: 0014-SUSE-mdadm_env.sh-handle-MDADM_CHECK_DURATION.patch Patch1001: 1001-display-timeout-status.patch %define _udevdir %(pkg-config --variable=udevdir udev) %define _systemdshutdowndir %{_unitdir}/../system-shutdown @@ -74,6 +77,9 @@ mdadm is a program that can be used to control Linux md devices. %patch19 -p1 %patch20 -p1 %patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 %patch1001 -p1 %build