summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-03-08 13:24:55 +0100
committerNeilBrown <neilb@suse.de>2011-03-09 08:42:40 +0100
commiteae35f5c55281caa3ba6be0d77ad9a1c6b74bbd8 (patch)
treee6bbfcbdccde166473a3638ce602684bf179643f /Grow.c
parentGrow: add check that there are enough devices. (diff)
downloadmdadm-eae35f5c55281caa3ba6be0d77ad9a1c6b74bbd8.tar.xz
mdadm-eae35f5c55281caa3ba6be0d77ad9a1c6b74bbd8.zip
FIX: Check correct 'old' level to see if reshape is needed.
Normally when reshape_array is called with restart == 0, info->array is the same as the 'array' read from the kernel (via ioctl) so both have the same level. However when called from reshape_container, info->array was generated by the metadata so it will have 'level' set to the intermediate (or final) level already. So to test if we need to change the level, we need to compare the desired level with that which was loaded from the kernel (array.level) rather than that which was read from metadata (info->array.level). Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Grow.c b/Grow.c
index 2c99924b..ecbc837e 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1707,7 +1707,7 @@ static int reshape_array(char *container, int fd, char *devname,
goto release;
}
- if (reshape.level != info->array.level) {
+ if (reshape.level != array.level) {
char *c = map_num(pers, reshape.level);
int err;
if (c == NULL)
@@ -1727,7 +1727,7 @@ static int reshape_array(char *container, int fd, char *devname,
if (!quiet)
fprintf(stderr, Name ": level of %s changed to %s\n",
devname, c);
- orig_level = info->array.level;
+ orig_level = array.level;
sysfs_freeze_array(info);
if (reshape.level > 0 && st->ss->external) {