Skip to contentSkip to conversation

mdadm: Stop mdcheck_continue timer when mdcheck_start service can finish check

PATCH Applied Xiao Ni 2 participants 2 messages Aug 25, 2023 – Sep 1, 2023 MD RAID

lore
Share & tools
lore

Xiao Ni

author
#0 lore raw

PATCH v2 1/1 mdadm: Stop mdcheck_continue timer when mdcheck_start service can finish check

mdcheck_continue is triggered by mdcheck_start timer. It's used to continue check action if the raid is too big and mdcheck_start service can't finish check action. If mdcheck start can finish check action, it doesn't need to mdcheck continue service anymore. So stop it when mdcheck start service can finish check action.

---
v2: fix typo errors and add spaces at the beginning of comments

 misc/mdcheck | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
misc/mdcheck +7 -1
index 700c3e252e72..f87999d3e797 100644
@@ -140,7 +140,13 @@ do
 		echo $a > $fl
 		any=yes
 	done
-	if [ -z "$any" ]; then exit 0; fi
+	# mdcheck_continue.timer is started by mdcheck_start.timer.
+	# When the check action can be finished in mdcheck_start.service,
+	# it doesn't need mdcheck_continue anymore.
+	if [ -z "$any" ]; then
+		systemctl stop mdcheck_continue.timer
+		exit 0;
+	fi
 	sleep 120
 done
 
Signature · 1 line
2.32.0 (Apple Git-132)
Applied
#1 lore raw
Quoted 22 lines · Xiao Ni

mdcheck_continue is triggered by mdcheck_start timer. It's used to continue check action if the raid is too big and mdcheck_start service can't finish check action. If mdcheck start can finish check action, it doesn't need to mdcheck continue service anymore. So stop it when mdcheck start service can finish check action.

---
v2: fix typo errors and add spaces at the beginning of comments

 misc/mdcheck | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
misc/mdcheck +0 -1
index 700c3e252e72..f87999d3e797 100644
@@ -140,7 +140,13 @@ do
 		echo $a > $fl
 		any=yes
 	done
-	if [ -z "$any" ]; then exit 0; fi

misc/mdcheck do · line 152

Quoted 10 lines
misc/mdcheck +7 -0
+	# mdcheck_continue.timer is started by mdcheck_start.timer.
+	# When the check action can be finished in mdcheck_start.service,
+	# it doesn't need mdcheck_continue anymore.
+	if [ -z "$any" ]; then
+		systemctl stop mdcheck_continue.timer
+		exit 0;
+	fi
 	sleep 120
 done
 

Applied!

Thanks,
Jes