diff options
-rw-r--r-- | mdadm.c | 5 | ||||
-rw-r--r-- | util.c | 3 |
2 files changed, 4 insertions, 4 deletions
@@ -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): @@ -194,6 +194,7 @@ long long parse_size(char *size) * followed by 'K', 'M', or 'G'. * Without a suffix, K is assumed. * Number returned is in sectors (half-K) + * -1 returned on error. */ char *c; long long s = strtoll(size, &c, 10); @@ -215,7 +216,7 @@ long long parse_size(char *size) } } if (*c) - s = 0; + s = -1; return s; } |