summaryrefslogtreecommitdiffstats
path: root/Create.c
diff options
context:
space:
mode:
authorLukasz Dorau <lukasz.dorau@intel.com>2012-11-16 17:24:36 +0100
committerNeilBrown <neilb@suse.de>2012-11-20 02:12:03 +0100
commit066e92f017df22c879c455494d2c1743ef7f3aca (patch)
treed5938b8367e0facf23498218713f07874399fd0f /Create.c
parentAssemble: fix call to wait_for (diff)
downloadmdadm-066e92f017df22c879c455494d2c1743ef7f3aca.tar.xz
mdadm-066e92f017df22c879c455494d2c1743ef7f3aca.zip
Create.c: check if freesize is equal 0
"freesize" can be equal 0, particularly after rounding to the chunk's size. Creating should be aborted in such case. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Create.c b/Create.c
index afcf1a53..436bd1d9 100644
--- a/Create.c
+++ b/Create.c
@@ -408,6 +408,11 @@ int Create(struct supertype *st, char *mddev,
do_default_chunk = 0;
}
}
+ if (!freesize) {
+ pr_err("no free space left on %s\n", dname);
+ fail = 1;
+ continue;
+ }
if (s->size && freesize < s->size) {
pr_err("%s is smaller than given size."