diff options
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/Incremental.c b/Incremental.c index d32a8e5..9d77d4d 100644 --- a/Incremental.c +++ b/Incremental.c @@ -424,20 +424,21 @@ int Incremental(char *devname, int verbose, int runstop, sysfs_uevent(&info, "change"); if (verbose >= 0) fprintf(stderr, Name - ": container %s now has %d devices\n", - chosen_name, info.array.working_disks); + ": container %s now has %d out of %d devices\n", + chosen_name, info.array.working_disks, + info.array.raid_disks); wait_for(chosen_name, mdfd); close(mdfd); - if (runstop < 0) - return 0; /* don't try to assemble */ - rv = Incremental(chosen_name, verbose, runstop, - NULL, homehost, require_homehost, autof); - if (rv == 1) - /* Don't fail the whole -I if a subarray didn't - * have enough devices to start yet + if (runstop > 0 || + info.array.working_disks == info.array.raid_disks) + /* The return value of our container assembly doesn't + * depend on whether or not subarrays assembled + * properly, so no need to preserve the return value + * here. */ - rv = 0; - return rv; + Incremental(chosen_name, verbose, runstop, NULL, + homehost, require_homehost, autof); + return 0; } avail = NULL; active_disks = count_active(st, mdfd, &avail, &info); @@ -666,6 +667,17 @@ int IncrementalScan(int verbose) if (mdfd < 0) continue; + if (strcmp("imsm",me->metadata) == 0) { + /* + * Just do a blind incremental assembly on the + * container. If there's anything to be started, + * we will, if it's already started, we'll silently + * exit, if there's a problem, incremental will + * catch it. + */ + Incremental(me->path, verbose, 1, NULL, "<any>", 0, 1); + continue; + } if (ioctl(mdfd, GET_ARRAY_INFO, &array) == 0 || errno != ENODEV) { close(mdfd); |