zfs raid level fix

This commit is contained in:
Harald Hope 2021-01-28 22:27:04 -08:00
parent 3a625f13ea
commit 244a8f3035

5
inxi
View file

@ -14962,10 +14962,14 @@ sub create_output_zfs {
@arrays = @{$row->{'arrays'}}; @arrays = @{$row->{'arrays'}};
@arrays = grep {defined $_} @arrays; @arrays = grep {defined $_} @arrays;
@arrays_holder = @arrays; @arrays_holder = @arrays;
my $count = scalar @arrays;
if (!defined $arrays[0]->{'level'} ){ if (!defined $arrays[0]->{'level'} ){
$level = 'no-raid'; $level = 'no-raid';
$rows[$j]->{main::key($num++,0,2,'level')} = $level; $rows[$j]->{main::key($num++,0,2,'level')} = $level;
} }
elsif ($count < 2 && $arrays[0]->{'level'}){
$rows[$j]->{main::key($num++,0,2,'level')} = $arrays[0]->{'level'};
}
if ($size){ if ($size){
#print "here 0\n"; #print "here 0\n";
$rows[$j]->{main::key($num++,0,2,'size')} = $size; $rows[$j]->{main::key($num++,0,2,'size')} = $size;
@ -14981,7 +14985,6 @@ sub create_output_zfs {
$rows[$j]->{main::key($num++,0,2,'allocated')} = $allocated; $rows[$j]->{main::key($num++,0,2,'allocated')} = $allocated;
$allocated = ''; $allocated = '';
} }
my $count = scalar @arrays;
foreach my $row2 (@arrays){ foreach my $row2 (@arrays){
if ($count > 1){ if ($count > 1){
$j = scalar @rows; $j = scalar @rows;