]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
parse_size: distinguish between 0 and error.
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 1efa3e80a2eb40292f9379eb0270b17bc1584f4d..4d4820d39394c8e5dfcbfa556a7875391cb989cf 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1056,15 +1056,14 @@ int main(int argc, char *argv[])
                case O(BUILD,BitmapChunk):
                case O(CREATE,BitmapChunk): /* bitmap chunksize */
                        bitmap_chunk = parse_size(optarg);
-                       if (bitmap_chunk < 0 ||
+                       if (bitmap_chunk <= 0 ||
                            bitmap_chunk & (bitmap_chunk - 1)) {
                                fprintf(stderr,
                                        Name ": invalid bitmap chunksize: %s\n",
                                        optarg);
                                exit(2);
                        }
-                       /* convert sectors to B, chunk of 0 means 512B */
-                       bitmap_chunk = bitmap_chunk ? bitmap_chunk * 512 : 512;
+                       bitmap_chunk = bitmap_chunk * 512;
                        continue;
 
                case O(GROW, WriteBehind):