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>
{
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;
}