summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-03-10 09:58:35 +1100
committerNeilBrown <neilb@suse.de>2011-03-10 09:58:35 +1100
commit140320165221099dd637fc84b60fe53f0d714c77 (patch)
tree255ddcea4f54a2306e7f26bd53a6c838982c18f2 /Assemble.c
parentb8063f0770e2a5d4a6dedc3bdc6ee114d1a7c4b7 (diff)
FIX: Make expansion counter usable
Currently whole array geometry is set in sysfs_set_array(), so none of disks (even for expansion) should fail during sysfs_add_disk() Due to this expansion counter should be used for reshaped array when disk slot is bigger than number of disks in array. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Assemble.c b/Assemble.c
index fe917b27..0ffbbc9a 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1526,13 +1526,14 @@ int assemble_container_content(struct supertype *st, int mdfd,
sysfs_free(sra);
for (dev = content->devs; dev; dev = dev->next)
- if (sysfs_add_disk(content, dev, 1) == 0)
- working++;
- else if (errno == EEXIST)
+ if (sysfs_add_disk(content, dev, 1) == 0) {
+ if (dev->disk.raid_disk >= content->array.raid_disks &&
+ content->reshape_active)
+ expansion++;
+ else
+ working++;
+ } else if (errno == EEXIST)
preexist++;
- else if (dev->disk.raid_disk >= content->array.raid_disks &&
- content->reshape_active)
- expansion++;
if (working == 0)
return 1;/* Nothing new, don't try to start */