[PATCH 1/2] fix: imsm: size must be in K for rounding to chunk
am 10.02.2011 09:33:33 von anna.czarnowskaFrom 77d66de281e818f93e97b3150dc0e610634463de Mon Sep 17 00:00:00 2001
From: Anna Czarnowska
Date: Tue, 8 Feb 2011 11:13:14 +0100
Subject: [PATCH 1/2] fix: imsm: size must be in K for rounding to chunk
Cc: linux-raid@vger.kernel.org, Williams, Dan J
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
---
super-intel.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 6a21b26..5c16137 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4379,7 +4379,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) ||
@@ -4392,8 +4393,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;
}
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html