]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Create: round to chunk size
authorNeilBrown <neilb@suse.de>
Mon, 6 Apr 2009 05:53:31 +0000 (15:53 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 6 Apr 2009 05:53:31 +0000 (15:53 +1000)
There are probably other places where rounding size to
chunksize is needed, or useful, but this is a good start.

Signed-off-by: NeilBrown <neilb@suse.de>
Create.c

index d33f891421795a3a00561fdb333df3a19ffda25b..9f52b41da9e7c9b5f1e2c1040bc381ee9087ac5a 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -261,6 +261,8 @@ int Create(struct supertype *st, char *mddev,
                return 1;
        }
        
+       if (size && chunk)
+               size &= ~(unsigned long long)(chunk - 1);
        newsize = size * 2;
        if (st && ! st->ss->validate_geometry(st, level, layout, raiddisks,
                                              chunk, size*2, NULL, &newsize, verbose>=0))