]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super0.c
Fix chunksize defaulting.
[thirdparty/mdadm.git] / super0.c
index 832072d83cd04f78154fe72ccd96b549157e8cfa..4f7110d08a0de28324ae4ed0af864d718d2f9c29 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -1113,12 +1113,12 @@ static int validate_geometry0(struct supertype *st, int level,
                        fprintf(stderr, Name ": 0.90 metadata supports at most 2 terrabytes per device\n");
                return 0;
        }
+       if (chunk && *chunk == UnSet)
+               *chunk = DEFAULT_CHUNK;
+
        if (!subdev)
                return 1;
 
-       if (chunk && (*chunk == 0 || *chunk == UnSet))
-               *chunk = DEFAULT_CHUNK;
-
        fd = open(subdev, O_RDONLY|O_EXCL, 0);
        if (fd < 0) {
                if (verbose)