From: NeilBrown Date: Thu, 2 Apr 2009 03:02:33 +0000 (+1100) Subject: ddf: make sure Create fails if devices are too small. X-Git-Tag: mdadm-3.0-rc1~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea17e7aa302355b52247a017ed388fc51317008e;p=thirdparty%2Fmdadm.git ddf: make sure Create fails if devices are too small. Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index 11a3bac9..7cc5ac66 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -2651,6 +2651,8 @@ validate_geometry_ddf_container(struct supertype *st, close(fd); *freesize = avail_size_ddf(st, ldsize >> 9); + if (*freesize == 0) + return 0; return 1; }