NeilBrown: Create: round to chunk size

Martin F. Krafft madduck at alioth.debian.org
Thu May 7 12:11:34 UTC 2009


Module: mdadm
Branch: debian/experimental
Commit: 9f3bd60c79a5c0941af7af8422299769f23b77df
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=9f3bd60c79a5c0941af7af8422299769f23b77df

Author: NeilBrown <neilb at suse.de>
Date:   Mon Apr  6 15:53:31 2009 +1000

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 <neilb at suse.de>

---

 Create.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Create.c b/Create.c
index d33f891..9f52b41 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))




More information about the pkg-mdadm-commits mailing list