diff options
author | NeilBrown <neilb@suse.de> | 2011-05-10 05:09:37 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-05-10 05:09:37 +0200 |
commit | 815c8a7e0b11b69331211b59b880ba50f3ed2b5e (patch) | |
tree | b61784eefd715513ab11ef8103d1efb20e57804a /Grow.c | |
parent | Grow: handle abort/restart of grow while being monitored. (diff) | |
download | mdadm-815c8a7e0b11b69331211b59b880ba50f3ed2b5e.tar.xz mdadm-815c8a7e0b11b69331211b59b880ba50f3ed2b5e.zip |
Grow: allow auto-readonly arrays to be reshaped.
In an array is auto-readonly then a reshape will not start.
But auto-readonly is only wanted until something is explicitly
done to acknowledge that the array is really wanted.
So it is perfectly correct to switch an auto-readonly array to
'clean' if a reshape has been requested.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r-- | Grow.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -521,9 +521,15 @@ static int freeze(struct supertype *st) else { struct mdinfo *sra = sysfs_read(-1, st->devnum, GET_VERSION); int err; + char buf[20]; if (!sra) return -1; + /* Need to clear any 'read-auto' status */ + if (sysfs_get_str(sra, NULL, "array_state", buf, 20) > 0 && + strncmp(buf, "read-auto", 9) == 0) + sysfs_set_str(sra, NULL, "array_state", "clean"); + err = sysfs_freeze_array(sra); sysfs_free(sra); return err; |