summaryrefslogtreecommitdiff
path: root/restripe.c
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2010-12-03 15:03:25 +1100
committerNeilBrown <neilb@suse.de>2010-12-03 15:03:25 +1100
commitb6e317c83ac95354c18e4946c5505fbe1401b558 (patch)
treee252c5fb5ec9324f9bd8c719f02dfbb4d1620afb /restripe.c
parente6e9d47b76227f4f30e27dcd00e6b0d815370b7c (diff)
FIX: Do not use layout for raid4 and raid0 while geo map computing
After takeover, layout has no meaning for computing geo map for raid0 and raid4. Set layout to 0 for such cases. It can happen after takeover operation when not all array information is reread. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'restripe.c')
-rw-r--r--restripe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/restripe.c b/restripe.c
index 3074693b..d33dbbad 100644
--- a/restripe.c
+++ b/restripe.c
@@ -43,6 +43,11 @@ static int geo_map(int block, unsigned long long stripe, int raid_disks,
*/
int pd;
+ /* layout is not relevant for raid0 and raid4 */
+ if ((level == 0) ||
+ (level == 4))
+ layout = 0;
+
switch(level*100 + layout) {
case 000:
case 400: