summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorCzarnowska, Anna <anna.czarnowska@intel.com>2011-02-13 23:27:09 +0100
committerNeilBrown <neilb@suse.de>2011-02-13 23:27:09 +0100
commit612e59d838b5480c2780a59f021eea2b32f3eb19 (patch)
tree6f284b6dc057b0093f49db953bf8b51acac14a6b /super-intel.c
parentimsm: Add information about failed disk to '-E' option (diff)
downloadmdadm-612e59d838b5480c2780a59f021eea2b32f3eb19.tar.xz
mdadm-612e59d838b5480c2780a59f021eea2b32f3eb19.zip
fix: imsm: size must be in K for rounding to chunk
chunk is in K so size must be converted to K before it is rounded. Otherwise we may get wrong freesize returned resulting in creation failure. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c
index 456eacc6..295aa1d0 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4384,7 +4384,8 @@ static int reserve_space(struct supertype *st, int raiddisks,
maxsize = merge_extents(super, extent_cnt);
minsize = size;
if (size == 0)
- minsize = chunk;
+ /* chunk is in K */
+ minsize = chunk * 2;
if (cnt < raiddisks ||
(super->orom && used && used != raiddisks) ||
@@ -4397,8 +4398,8 @@ static int reserve_space(struct supertype *st, int raiddisks,
if (size == 0) {
size = maxsize;
if (chunk) {
- size /= chunk;
- size *= chunk;
+ size /= 2 * chunk;
+ size *= 2 * chunk;
}
}