From fcdfb8148853e33757171cc2c12e4c95795063cd Mon Sep 17 00:00:00 2001 From: Adam Kwolek Date: Thu, 10 Mar 2011 11:41:28 +1100 Subject: [PATCH] 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 --- Grow.c | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.47.2