[PATCH 3/5] FIX: Set readonly state in Grow_continue() when necessary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

 Grow.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Grow.c b/Grow.c
index cb52cc5..e321a39 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;
 	}

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux