Thread (20 messages) 20 messages, 2 authors, 2010-11-23

Re: [PATCH 03/13] Manage: allow manual control of external raid0 readonly flag

From: Neil Brown <hidden>
Date: 2010-11-23 04:08:22
Subsystem: the rest · Maintainer: Linus Torvalds

On Thu, 18 Nov 2010 10:21:45 +0100
Krzysztof Wojcik [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Dan Williams <redacted>

mdadm --readwrite <subarray> will clear the external readonly flag ('-'
to '/'), but only for redudant arrays.  Allow raid0 arrays as well so
the user has a simple helper to control this flag.

Signed-off-by: Dan Williams <redacted>
---
 Manage.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/Manage.c b/Manage.c
index 6e9d4a0..ac9415b 100644
--- a/Manage.c
+++ b/Manage.c
@@ -56,7 +56,6 @@ int Manage_ro(char *devname, int fd, int readonly)
 	mdi = sysfs_read(fd, -1, GET_LEVEL|GET_VERSION);
 	if (mdi &&
 	    mdi->array.major_version == -1 &&
-	    mdi->array.level > 0 &&
 	    is_subarray(mdi->text_version)) {
 		char vers[64];
 		strcpy(vers, "external:");

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
I've added:
diff --git a/Manage.c b/Manage.c
index 919dc01..a203ec9 100644
--- a/Manage.c
+++ b/Manage.c
@@ -87,6 +87,8 @@ int Manage_ro(char *devname, int fd, int readonly)
 			if (*cp)
 				*cp = 0;
 			ping_monitor(vers+10);
+			if (mdi->array.level <= 0)
+				sysfs_set_str(mdi, NULL, "array_state", "active");
 		}
 		return 0;
 	}

so that you can set raid0 to --readonly again.  Yell if you think that is
wrong.

NeilBrown
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help