FIX: Set readonly state in Grow_continue() when necessary

When assembling array using assemble_container_content() for external
metadata case, array is in 'readonly' state already.
There is not necessary to duplicate this operation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-02-28 16:07:19 +01:00 committed by NeilBrown
parent 864a004f7e
commit ef5414b282
1 changed files with 6 additions and 4 deletions

10
Grow.c
View File

@ -3325,11 +3325,13 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
{
char buf[40];
char *container = NULL;
int err = sysfs_set_str(info, NULL, "array_state", "readonly");
if (err)
return err;
int err;
if (st->ss->external) {
if (!st->ss->external) {
err = sysfs_set_str(info, NULL, "array_state", "readonly");
if (err)
return err;
} else {
fmt_devname(buf, st->container_dev);
container = buf;
}