]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: Frozen array can't be idle
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Wed, 1 Aug 2018 13:29:31 +0000 (15:29 +0200)
committerJes Sorensen <jsorensen@fb.com>
Wed, 1 Aug 2018 15:57:43 +0000 (11:57 -0400)
When array is frozen but there is no recovery/reshape in mdstat,
check_idle() will not return error but grow countinue can still working.

Check is array frozen. Do not use sysfs sync_action parameter because it
doesn't exist for Raid0, simply check metadata_version in mdstat.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index 30c5fa91c06d7c1b38b342cfbaff5df06645f913..4436a4d6bd4cdff4fe3ebe03c2a1f3eebdf33196 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -754,7 +754,8 @@ static int check_idle(struct supertype *st)
        for (e = ent ; e; e = e->next) {
                if (!is_container_member(e, container))
                        continue;
-               if (e->percent >= 0) {
+               /* frozen array is not idle*/
+               if (e->percent >= 0 || e->metadata_version[9] == '-') {
                        is_idle = 0;
                        break;
                }