summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-10-25 18:20:49 +1100
committerNeilBrown <neilb@suse.de>2008-10-25 18:20:49 +1100
commitb3d3195538e315b3863235731112eee7398d4340 (patch)
tree7decf7dd32fe805c1206efc93e54fea1f23af378 /mdadm.c
parent11cd8b79c0690bf39b40a25352f86a82a838622a (diff)
downloadmdadm-b3d3195538e315b3863235731112eee7398d4340.tar.gz
mdadm-b3d3195538e315b3863235731112eee7398d4340.tar.xz
mdadm-b3d3195538e315b3863235731112eee7398d4340.zip
Allow WRITEMOSTLY to be cleared on --readd using --readwrite.
Previously it was possible to set the WRITEMOSTLY flag when adding a device to an array, but not to clear the flag when re-adding. This is now possible with --readwrite. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/mdadm.c b/mdadm.c
index 3aa3b13..af9627d 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -360,6 +360,12 @@ int main(int argc, char *argv[])
writemostly = 1;
continue;
+ case O(MANAGE,'w'):
+ /* clear write-mostly for following devices */
+ writemostly = 2;
+ continue;
+
+
case O(GROW,'z'):
case O(CREATE,'z'): /* size */
if (size >= 0) {
@@ -745,21 +751,6 @@ int main(int argc, char *argv[])
runstop = -1;
continue;
- case O(MANAGE,'o'):
- if (readonly < 0) {
- fprintf(stderr, Name ": Cannot have both readonly and readwrite\n");
- exit(2);
- }
- readonly = 1;
- continue;
- case O(MANAGE,'w'):
- if (readonly > 0) {
- fprintf(stderr, Name ": Cannot have both readwrite and readonly.\n");
- exit(2);
- }
- readonly = -1;
- continue;
-
case O(MISC,'Q'):
case O(MISC,'D'):
case O(MISC,'E'):