Skip to contentSkip to conversation

Stop mdcheck_continue timer when mdcheck_start service can finish check

PATCH Superseded Xiao Ni 2 participants 4 messages May 8, 2023 – Aug 25, 2023 MD RAID

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Xiao Ni

author
#0 lore raw

PATCH 1/1 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.

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

Hi Xiao,
some nits:

Quoted 16 lines · On Mon, 8 May 2023 21:30:10 +0800 Xiao Ni <[email protected]> wrote:

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.

---
 misc/mdcheck | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
misc/mdcheck +0 -0
index 700c3e252e72..f56972c8ed10 100644

misc/mdcheck do · line 145

Quoted 7 lines
misc/mdcheck +3 -1
@@ -140,7 +140,13 @@ do
 		echo $a > $fl
 		any=yes
 	done
-	if [ -z "$any" ]; then exit 0; fi
+	if [ -z "$any" ]; then
+		#mdcheck_continue.timer is started by mdcheck_start.timer.
+		#When he check action can be finished in

's/he/the/g'
I think that there should be space after '#' but it is preferred to use /* */ Could you please send v2?

Thanks,
Mariusz

author
#2 lore raw
Quoted 18 lines · Mariusz Tkaczyk

Hi Xiao,
some nits:

Quoted 11 lines · On Mon, 8 May 2023 21:30:10 +0800 Xiao Ni <[email protected]> wrote:

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.

---
 misc/mdcheck | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Quoted 15 lines

misc/mdcheck do · line 145

Quoted 12 lines
misc/mdcheck +3 -1
index 700c3e252e72..f56972c8ed10 100644
@@ -140,7 +140,13 @@ do
              echo $a > $fl
              any=yes
      done
-     if [ -z "$any" ]; then exit 0; fi
+     if [ -z "$any" ]; then
+             #mdcheck_continue.timer is started by mdcheck_start.timer.
+             #When he check action can be finished in

's/he/the/g'
I think that there should be space after '#' but it is preferred to use /* */ Could you please send v2?

Hi Mariusz

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
 

How about this one?

Regards
Xiao

Quoted 4 lines

Thanks,
Mariusz

#3 lore raw
Quoted 59 lines · On Fri, 25 Aug 2023 17:00:19 +0800 Xiao Ni <[email protected]> wrote:
Quoted 18 lines · Mariusz Tkaczyk

Hi Xiao,
some nits:

Quoted 11 lines · On Mon, 8 May 2023 21:30:10 +0800 Xiao Ni <[email protected]> wrote:

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.

---
 misc/mdcheck | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Quoted 15 lines

misc/mdcheck do · line 145

Quoted 12 lines
misc/mdcheck +3 -1
index 700c3e252e72..f56972c8ed10 100644
@@ -140,7 +140,13 @@ do
              echo $a > $fl
              any=yes
      done
-     if [ -z "$any" ]; then exit 0; fi
+     if [ -z "$any" ]; then
+             #mdcheck_continue.timer is started by mdcheck_start.timer.
+             #When he check action can be finished in  

's/he/the/g'
I think that there should be space after '#' but it is preferred to use /* */ Could you please send v2?

Hi Mariusz

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
 

How about this one?

Quoted 7 lines

Regards
Xiao

Quoted 4 lines

Thanks,
Mariusz

LGTM

Mariusz