From: NeilBrown Date: Mon, 6 Apr 2009 05:53:31 +0000 (+1000) Subject: Create: round to chunk size X-Git-Tag: mdadm-3.0-rc1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f3bd60c79a5c0941af7af8422299769f23b77df;p=thirdparty%2Fmdadm.git Create: round to chunk size There are probably other places where rounding size to chunksize is needed, or useful, but this is a good start. Signed-off-by: NeilBrown --- diff --git a/Create.c b/Create.c index d33f8914..9f52b41d 100644 --- 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))