dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0077-mdcheck-Log-when-done.patch

d805ba
From 3b7aae927bdb6e150d1aaf3aaf0d183a06abda0b Mon Sep 17 00:00:00 2001
d805ba
From: Donald Buczek <buczek@molgen.mpg.de>
d805ba
Date: Wed, 13 May 2020 15:16:46 +0200
d805ba
Subject: [RHEL7.9 PATCH 77/77] mdcheck: Log when done
d805ba
d805ba
Currently mdcheck (when called with `--duration`) logs only the
d805ba
beginning of the check, the pausing and the continuation but not the
d805ba
completion.
d805ba
d805ba
So, log the completion, too, so that it can be determined how long the
d805ba
raid check took.
d805ba
d805ba
    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md0
d805ba
    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md1
d805ba
    2020-05-09T15:32:04+02:00 deadpool root: mdcheck finished checking /dev/md1
d805ba
    2020-05-09T17:38:04+02:00 deadpool root: mdcheck finished checking /dev/md0
d805ba
d805ba
Cc: linux-raid@vger.kernel.org
d805ba
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
d805ba
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
d805ba
---
d805ba
 misc/mdcheck | 2 ++
d805ba
 1 file changed, 2 insertions(+)
d805ba
d805ba
diff --git a/misc/mdcheck b/misc/mdcheck
d805ba
index 42d4094..700c3e2 100644
d805ba
--- a/misc/mdcheck
d805ba
+++ b/misc/mdcheck
d805ba
@@ -125,11 +125,13 @@ do
d805ba
 	do
d805ba
 		eval fl=\$MD_${i}_fl
d805ba
 		eval sys=\$MD_${i}_sys
d805ba
+		eval dev=\$MD_${i}_dev
d805ba
 
d805ba
 		if [ -z "$fl" ]; then continue; fi
d805ba
 
d805ba
 		if [ "`cat $sys/md/sync_action`" != 'check' ]
d805ba
 		then
d805ba
+			logger -p daemon.info mdcheck finished checking $dev
d805ba
 			eval MD_${i}_fl=
d805ba
 			rm -f $fl
d805ba
 			continue;
d805ba
-- 
d805ba
2.7.5
d805ba