diff options
author | Doug Ledford <dledford@redhat.com> | 2010-04-08 16:56:02 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2010-04-13 15:05:36 -0400 |
commit | e8bf7042ed064590abf44b61ad8d99b1592c0af4 (patch) | |
tree | 4531c37c88288f8549ff14b575835d95484d2c98 /Incremental.c | |
parent | 4eea172155fba6b2e57582ed647a0a98890f1670 (diff) | |
download | mdadm-e8bf7042ed064590abf44b61ad8d99b1592c0af4.tar.gz mdadm-e8bf7042ed064590abf44b61ad8d99b1592c0af4.tar.xz mdadm-e8bf7042ed064590abf44b61ad8d99b1592c0af4.zip |
Make Incremental container assembly behave like native array assembly
Signed-off-by: Doug Ledford <dledford@redhat.com>
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); |