diff options
author | Adam Kwolek <adam.kwolek@intel.com> | 2011-10-06 11:13:22 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-07 09:46:07 +1100 |
commit | 3bd58dc65f154993f2cc8b1460c67884cb901605 (patch) | |
tree | dbc013ffd654792a03699045aad7abd0deb9468d /Assemble.c | |
parent | ea672ee1190e3ce4e4f0a0e612f9dd1808b31c41 (diff) |
Always run Grow_continue() for started array.
So far there were 2 reshape continuation cases:
1. array is started /e.g. reshape was already invoked during initrd
start-up stage using "--freeze-reshape" option/
2. array is not started yet /"normal" assembling array under reshape case/
This patch narrows continuation cases in to single one. To do this
array should be started /set readonly in to array_state/ before calling
Grow_continue() function.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r-- | Assemble.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -1343,10 +1343,14 @@ int Assemble(struct supertype *st, char *mddev, int rv; #ifndef MDASSEMBLE if (content->reshape_active && - content->delta_disks <= 0) - rv = Grow_continue(mdfd, st, content, - backup_file, freeze_reshape); - else + content->delta_disks <= 0) { + rv = sysfs_set_str(content, NULL, + "array_state", "readonly"); + if (rv == 0) + rv = Grow_continue(mdfd, st, content, + backup_file, + freeze_reshape); + } else #endif rv = ioctl(mdfd, RUN_ARRAY, NULL); if (rv == 0) { @@ -1561,6 +1565,11 @@ int assemble_container_content(struct supertype *st, int mdfd, spare, backup_file, verbose) == 1) return 1; + err = sysfs_set_str(content, NULL, + "array_state", "readonly"); + if (err) + return 1; + if (st->ss->external) { if (!mdmon_running(st->container_dev)) start_mdmon(st->container_dev); |