]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Reject '--bitmap none' for build and create.
authorNeil Brown <neilb@suse.de>
Mon, 23 Jul 2007 07:28:44 +0000 (17:28 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 23 Jul 2007 07:28:44 +0000 (17:28 +1000)
We don't want to create a file called 'none', and it isn't needed,
so just reject it.

mdadm.c

diff --git a/mdadm.c b/mdadm.c
index 45ffaee27508f004db19d6e247a5876f2992c73e..40fdccf758f87c51ade57d2d637d4e845ef60642 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -817,9 +817,15 @@ int main(int argc, char *argv[])
                        backup_file = optarg;
                        continue;
 
-               case O(GROW,'b'):
                case O(BUILD,'b'):
                case O(CREATE,'b'): /* here we create the bitmap */
+                       if (strcmp(optarg, "none") == 0) {
+                               fprintf(stderr, Name ": '--bitmap none' only"
+                                       " support for --grow\n");
+                               exit(2);
+                       }
+                       /* FALL THROUGH */
+               case O(GROW,'b'):
                        if (strcmp(optarg, "internal")== 0 ||
                            strcmp(optarg, "none")== 0 ||
                            strchr(optarg, '/') != NULL) {