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 <zlliu@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
This commit is contained in:
Zhilong Liu 2017-03-20 13:21:03 +08:00 committed by Jes Sorensen
parent 7054da69c7
commit 27c48b375d
1 changed files with 4 additions and 0 deletions

View File

@ -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) {