From 126777bc019a54afb4ec51299f2cf9d2841698aa Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 25 Apr 2007 12:26:16 +0000 Subject: re-sync after the big svn loss --- perl-install/raid.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'perl-install/raid.pm') diff --git a/perl-install/raid.pm b/perl-install/raid.pm index 3a251439e..135218344 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -85,9 +85,10 @@ sub updateSize { my @l = map { $_->{size} } @{$part->{disks}}; $part->{size} = do { - if (/0|linear/) { sum @l } - elsif (/1/) { min @l } - elsif (/4|5/) { min(@l) * $#l } + if (/0|linear/) { sum @l } + elsif (/1/) { min @l } + elsif (/4|5/) { min(@l) * (@l - 1) } + elsif (/6/) { min(@l) * (@l - 2) } }; } @@ -145,7 +146,8 @@ sub format_part { sub verify { my ($raids) = @_; foreach (@$raids) { - @{$_->{disks}} >= ($_->{level} =~ /4|5/ ? 3 : 2) or die N("Not enough partitions for RAID level %d\n", $_->{level}); + my $nb = $_->{level} =~ /6/ ? 4 : $_->{level} =~ /4|5/ ? 3 : 2; + @{$_->{disks}} >= $nb or die N("Not enough partitions for RAID level %d\n", $_->{level}); } } @@ -198,7 +200,7 @@ sub get_existing { foreach my $md (active_mds()) { my $raw_part = get_md_info(devices::make($md)) or next; - $raw_part->{level} =~ s/raid//; #- { linear | raid0 | raid1 | raid5 } -> { linear | 0 | 1 | 5 } + $raw_part->{level} =~ s/raid//; #- { linear | raid0 | raid1 | raid5 | raid6 } -> { linear | 0 | 1 | 5 | 6 } my @mdparts = map { -- cgit v1.2.1