From b3d3195538e315b3863235731112eee7398d4340 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 25 Oct 2008 18:20:49 +1100 Subject: 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 --- mdadm.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'mdadm.c') 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'): -- cgit