]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm:it doesn't make sense to set --bitmap twice
authorZhilong Liu <zlliu@suse.com>
Mon, 20 Mar 2017 05:21:03 +0000 (13:21 +0800)
committerJes Sorensen <Jes.Sorensen@gmail.com>
Mon, 27 Mar 2017 22:14:09 +0000 (18:14 -0400)
mdadm.c: it doesn't make sense to set --bitmap twice.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
mdadm.c

diff --git a/mdadm.c b/mdadm.c
index d6ad8dc28967e2886a2f4dee4146d1859010ace2..08ddcabcc7865acfd9726c1758bf2963663bbb9e 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1139,6 +1139,10 @@ int main(int argc, char *argv[])
                case O(CREATE,Bitmap): /* here we create the bitmap */
                case O(GROW,'b'):
                case O(GROW,Bitmap):
+                       if (s.bitmap_file) {
+                               pr_err("bitmap cannot be set twice. Second value: %s.\n", optarg);
+                               exit(2);
+                       }
                        if (strcmp(optarg, "internal") == 0 ||
                            strcmp(optarg, "none") == 0 ||
                            strchr(optarg, '/') != NULL) {