From: Nathan Scott Date: Mon, 6 Jun 2005 03:50:11 +0000 (+0000) Subject: Fixup that last fix attempting to not align on linear MD arrays; also added in RAID4... X-Git-Tag: v2.7.0~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ad6fbfa5462c19e74df790821538cc85f9ce189;p=thirdparty%2Fxfsprogs-dev.git Fixup that last fix attempting to not align on linear MD arrays; also added in RAID4/6/10 support. Merge of master-melb:xfs-cmds:22819a by kenmcd. --- diff --git a/libdisk/md.c b/libdisk/md.c index c3eed2ef0..bbf773294 100644 --- a/libdisk/md.c +++ b/libdisk/md.c @@ -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;