diff options
author | Lukasz Dorau <lukasz.dorau@intel.com> | 2012-11-16 17:24:36 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-11-20 02:12:03 +0100 |
commit | 066e92f017df22c879c455494d2c1743ef7f3aca (patch) | |
tree | d5938b8367e0facf23498218713f07874399fd0f /Create.c | |
parent | Assemble: fix call to wait_for (diff) | |
download | mdadm-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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." |