]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Set 'active' array state before array configuration
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 10 Mar 2011 00:41:28 +0000 (11:41 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 10 Mar 2011 00:41:28 +0000 (11:41 +1100)
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 <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 734fa6dccbd0092d2e34ab976b904d744c676825..d596c2de7a7df6bd9ebe0eafdb3e55c365f66f9b 100644 (file)
--- 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) {