From: Zhilong Liu Date: Mon, 20 Mar 2017 05:21:03 +0000 (+0800) Subject: mdadm:it doesn't make sense to set --bitmap twice X-Git-Tag: mdadm-4.1-rc1~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27c48b375d8fb6b4835fd9b11593c75d247ea1c1;p=thirdparty%2Fmdadm.git mdadm:it doesn't make sense to set --bitmap twice mdadm.c: it doesn't make sense to set --bitmap twice. Signed-off-by: Zhilong Liu Signed-off-by: Jes Sorensen --- diff --git a/mdadm.c b/mdadm.c index d6ad8dc2..08ddcabc 100644 --- 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) {