From: Adam Kwolek Date: Mon, 28 Feb 2011 15:07:19 +0000 (+0100) Subject: FIX: Set readonly state in Grow_continue() when necessary X-Git-Tag: mdadm-3.2.1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef5414b282ac79d04e3f9545acbcffc12eaf3468;p=thirdparty%2Fmdadm.git 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 Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index cb52cc5a..e321a391 100644 --- a/Grow.c +++ b/Grow.c @@ -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; }