Commit be56bd15 authored by Fulvio Galeazzi's avatar Fulvio Galeazzi
Browse files

2018-11-06: FG; Fixed bug when OSD size is zero.

parent 3d32df2d
...@@ -174,14 +174,13 @@ foreach my $_lineS (@_dataSize) ...@@ -174,14 +174,13 @@ foreach my $_lineS (@_dataSize)
my $frac = $fields[7]; my $frac = $fields[7];
my $size = $fields[4]; my $size = $fields[4];
$size =~ s/iB$//; $size =~ s/iB$//;
$size =~ s/B$//;
my $sizeLastChar = lc(chop($size)); my $sizeLastChar = lc(chop($size));
if ($sizeLastChar eq "t") { if ($sizeLastChar eq "t") {
$size = $size * 1000.; $size = $size * 1000.;
} elsif ($sizeLastChar eq "g") {
$size += 0.;
} else {
$size = $fields[4];
} }
$size += 0.;
push (@{$dataSizeH{$size}}, $osdNum); push (@{$dataSizeH{$size}}, $osdNum);
push (@{$dataTypeH{$type}}, $osdNum); push (@{$dataTypeH{$type}}, $osdNum);
push (@{$fracSizeH{$size}}, $frac); push (@{$fracSizeH{$size}}, $frac);
......
...@@ -197,14 +197,13 @@ foreach my $_line (@_data) ...@@ -197,14 +197,13 @@ foreach my $_line (@_data)
my $frac = $fields[7]; my $frac = $fields[7];
my $size = $fields[4]; my $size = $fields[4];
$size =~ s/iB$//; $size =~ s/iB$//;
$size =~ s/B$//;
my $sizeLastChar = lc(chop($size)); my $sizeLastChar = lc(chop($size));
if ($sizeLastChar eq "t") { if ($sizeLastChar eq "t") {
$size = $size * 1000.; $size = $size * 1000.;
} elsif ($sizeLastChar eq "g") {
$size += 0.;
} else {
$size = $fields[4];
} }
$size += 0.;
next unless ($size); next unless ($size);
push (@{$dataHash{$size}}, $osdNum); push (@{$dataHash{$size}}, $osdNum);
push (@{$typeHash{$type}}, $osdNum); push (@{$typeHash{$type}}, $osdNum);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment