From: Adam Kwolek Date: Thu, 10 Mar 2011 00:41:28 +0000 (+1100) Subject: FIX: Set 'active' array state before array configuration X-Git-Tag: mdadm-3.2.1~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcdfb8148853e33757171cc2c12e4c95795063cd;p=thirdparty%2Fmdadm.git FIX: Set 'active' array state before array configuration For not reshaped array in container during assembly array is in auto-read-only state. It is not possible to set disk slot for such array and later reshape cannot be started also. To move array from 'auto-read-only' to 'active' state storing 'active' state to sysfs is added. This allows for disks configuration and reshape. During reshaped array restart it is disabled by condition on restart variable. When reshape is starting, storing 'active' state to already active array should not matter. Signed-off-by: Adam Kwolek Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 734fa6dc..d596c2de 100644 --- a/Grow.c +++ b/Grow.c @@ -1654,6 +1654,9 @@ static int reshape_array(char *container, int fd, char *devname, info->new_level = UnSet; msg = analyse_change(info, &reshape); info->new_level = new_level; + if (!restart) + /* Make sure the array isn't read-only */ + ioctl(fd, RESTART_ARRAY_RW, 0); } else msg = analyse_change(info, &reshape); if (msg) {