FIX: Array after takeover has to be frozen

Problem occurs when we want to expand single disk raid0 array.
This is done via degraded 2 disks raid4 array. When new spare
is added to array, md immediately initiates recovery before
mdadm can configure and start reshape. This is due fact that 2 disk
raid4/5 array is special md case. Mdmon does nothing here because
container is blocked.
Put array in to frozen state allows mdadm to finish configuration
before reshape is executed in md.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-01-26 16:03:41 +01:00 committed by NeilBrown
parent d7d205bd25
commit a9c3e78fdd
1 changed files with 6 additions and 0 deletions

6
Grow.c
View File

@ -1632,6 +1632,12 @@ static int reshape_array(char *container, int fd, char *devname,
return 0;
goto started;
}
/* The container is frozen but the array may not be.
* So freeze the array so spares don't get put to the wrong use
* FIXME there should probably be a cleaner separation between
* freeze_array and freeze_container.
*/
sysfs_freeze_array(info);
spares_needed = max(reshape.before.data_disks,
reshape.after.data_disks)
+ reshape.parity - array.raid_disks;