]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Fix chunksize defaulting.
[thirdparty/mdadm.git] / super1.c
index be0591677c2f6f2fed705af679dd9a9738597665..9299322fff9c4844a440c5619059619b1ceb51df 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1666,12 +1666,12 @@ static int validate_geometry1(struct supertype *st, int level,
                        fprintf(stderr, Name ": 1.x metadata does not support containers\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)