From e50dbb258d4166b11f9a1e6a2104274cfb5d6873 Mon Sep 17 00:00:00 2001
From: Surbhi Palande <surbhi.palande@canonical.com>
Date: Tue, 21 Sep 2010 18:05:20 +0300
Subject: [PATCH 05/19] mapfile - Fix off-by-one error in RebuildMap

LP: #550131

"mdadm -I(r)" would get the path for md0 wrong because it
went looking for mdp(-1) by mistake.

Neil Brown: 60f8cb9b02af3c55708c44b40425f57282c8937c

Signed-off-by: Surbhi Palande <surbhi.palande@canonical.com>
---
 Incremental.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index 46301be..167366c 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -622,7 +622,7 @@ void RebuildMap(void)
 			if (ok != 0)
 				continue;
 			st->ss->getinfo_super(st, &info);
-			if (md->devnum > 0)
+			if (md->devnum >= 0)
 				path = map_dev(MD_MAJOR, md->devnum, 0);
 			else
 				path = map_dev(mdp, (-1-md->devnum)<< 6, 0);
-- 
1.7.0.4