]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: allow monitor thread to exit when there is nothing more to do.
authorNeilBrown <neilb@suse.de>
Thu, 10 Mar 2011 04:59:24 +0000 (15:59 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 10 Mar 2011 04:59:24 +0000 (15:59 +1100)
When an array using native metadata is increasing in size, we don't
need to keep monitoring it after the initial 'critical section'.
So detect that case.
If a final level-change is still needed mdadm will wait for that,
otherwise it will simply exit.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index c11b1cee96324f879642256357700e028b0d434e..9b4d5fbdcecb7981c1acc53eae2dc2f8460b6f19 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -3016,6 +3016,11 @@ int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape,
                                done = 1;
                        break;
                }
+               if (rv == 0 && increasing && !st->ss->external) {
+                       /* No longer need to monitor this reshape */
+                       done = 1;
+                       break;
+               }
 
                while (rv) {
                        unsigned long long offset;