]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Do not use layout for raid4 and raid0 while geo map computing
authorAdam Kwolek <adam.kwolek@intel.com>
Fri, 3 Dec 2010 04:03:25 +0000 (15:03 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 3 Dec 2010 04:03:25 +0000 (15:03 +1100)
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>
restripe.c

index 3074693bd2c3f8f36faa4f63ed76a01cacaf07d1..d33dbbad81005992ce46f1eb4e6eae7317417167 100644 (file)
@@ -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: