]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fixup that last fix attempting to not align on linear MD arrays; also added in RAID4...
authorNathan Scott <nathans@sgi.com>
Mon, 6 Jun 2005 03:50:11 +0000 (03:50 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 6 Jun 2005 03:50:11 +0000 (03:50 +0000)
Merge of master-melb:xfs-cmds:22819a by kenmcd.

libdisk/md.c

index c3eed2ef07be8ab558e65eaabf3808df3d5dd2b1..bbf77329425cc5c352bf9e7d766b29446ba6022d 100644 (file)
@@ -68,13 +68,25 @@ md_get_subvol_stripe(
                }
                close(fd);
 
-               /* Ignore concat and mirror volumes */
-               if (md.level == 0 || md.level == 1)
-                       return 0;
-
-               /* Deduct a disk from stripe width on RAID4/5 */
-               if (md.level == 4 || md.level == 5)
+               /*
+                * Ignore levels we don't want aligned (e.g. linear)
+                * and deduct disk(s) from stripe width on RAID4/5/6
+                */
+               switch (md.level) {
+               case 6:
+                       md.nr_disks--;
+                       /* fallthrough */
+               case 5:
+               case 4:
                        md.nr_disks--;
+                       /* fallthrough */
+               case 1:
+               case 0:
+               case 10:
+                       break;
+               default:
+                       return 0;
+               }
 
                /* Update sizes */
                *sunit = md.chunk_size >> 9;