dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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