a2b3d7f053
we are supposed to - Add a rule to run incremental assembly on containers in case there are multiple volumes in a container and we only started some of them in the initramfs - Make -If work with imsm arrays. We had too restrictive of a test in sysfs_unique_holder. - Make incremental assembly of containers act like incremental assembly of regular devices (aka, --run is needed to start a degraded array)
96 lines
3.2 KiB
Diff
96 lines
3.2 KiB
Diff
commit 3f45610e6b9e2419f09f7f1b415170b6128d91ad
|
|
Author: Doug Ledford <dledford@redhat.com>
|
|
Date: Thu Apr 8 12:39:03 2010 -0400
|
|
|
|
Make Incremental container assembly behave like native array assembly
|
|
|
|
Signed-off-by: Doug Ledford <dledford@redhat.com>:4000
|
|
|
|
diff --git a/Assemble.c b/Assemble.c
|
|
index 1504f1f..d059155 100644
|
|
--- a/Assemble.c
|
|
+++ b/Assemble.c
|
|
@@ -1327,8 +1327,10 @@ int assemble_container_content(struct supertype *st, int mdfd,
|
|
content->text_version,
|
|
content->uuid, chosen_name);
|
|
|
|
- if (runstop > 0 ||
|
|
- (working + preexist) >= content->array.working_disks) {
|
|
+ if ((runstop > 0 &&
|
|
+ (working + preexist) >= content->array.working_disks) ||
|
|
+ (runstop == 0 &&
|
|
+ (working + preexist) == content->array.raid_disks)) {
|
|
int err;
|
|
|
|
switch(content->array.level) {
|
|
diff --git a/Incremental.c b/Incremental.c
|
|
index d32a8e5..2a2df82 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 == 1 ||
|
|
+ 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);
|
|
diff --git a/super-intel.c b/super-intel.c
|
|
index 999b970..7bcfcdb 100644
|
|
--- a/super-intel.c
|
|
+++ b/super-intel.c
|
|
@@ -1536,12 +1536,27 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info)
|
|
if (super->current_vol >= 0) {
|
|
getinfo_super_imsm_volume(st, info);
|
|
return;
|
|
+ } else {
|
|
+ struct mdinfo vol_info;
|
|
+
|
|
+ super->current_vol = 0;
|
|
+ getinfo_super_imsm_volume(st, &vol_info);
|
|
+ super->current_vol = -1;
|
|
+ info->array.raid_disks = vol_info.array.raid_disks;
|
|
}
|
|
|
|
/* Set raid_disks to zero so that Assemble will always pull in valid
|
|
* spares
|
|
- */
|
|
+ *
|
|
+ * Note: my testing with assemble shows that it still works even
|
|
+ * when we set the raid_disks to a proper setting. However, without
|
|
+ * this it is impossible to tell when a container has the right
|
|
+ * number of disks to start cleanly without violating layering
|
|
+ * boundaries. So, not violating layering boundaries trumps spare
|
|
+ * disk issues. Doug Ledford
|
|
+ *
|
|
info->array.raid_disks = 0;
|
|
+ */
|
|
info->array.level = LEVEL_CONTAINER;
|
|
info->array.layout = 0;
|
|
info->array.md_minor = -1;
|