Skip to content

Commit

Permalink
mxraid/mxraid_assemble: Fix smartctl callup
Browse files Browse the repository at this point in the history
Possible cause for the bug:

smartctl_info was only tested when starting the code, later
on the the switch from a simple device key to dev_list was
forgotten in this function.
  • Loading branch information
thomas committed Feb 16, 2023
1 parent 76d03b6 commit 00cfc1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mxraid/mxraid_assemble
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ exit;
$serial_number =~ s/^\s+//;
} else {
if ($self->{root_priv}) {
$serial_number = smartctl_info($dev_list->[$i], 'Serial_Number');
$serial_number = smartctl_info('/dev/'.$dk, 'Serial_Number');
} else {
warn "# You must be root to query '$dk'.\n" if $self->{verbose} >= 1;
}
Expand Down Expand Up @@ -801,6 +801,7 @@ exit;
if ($parse) {
my ($key, $val) = $_ =~ m/^([^:]+):\s*(.+)$/;
next unless defined $key and defined $val;
$key =~ s/\s+/_/g;
$smart_data{$key} = $val;
}
}
Expand Down

0 comments on commit 00cfc1f

Please sign in to comment.