tools: smart: only throw error for smartctl fatal errors
only bit 0-2 are fatal errors, bit 3-7 are used to indicate some drive conditions. for details see the manpage of smartctl(8) Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> [ Thomas: resolved merge-conflict due to moved run_command ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
bbd57396d7
commit
af2eb422d5
@ -91,7 +91,9 @@ pub fn get_smart_data(
|
||||
};
|
||||
command.arg(disk_path);
|
||||
|
||||
let output = pbs_tools::run_command(command, None)?;
|
||||
let output = pbs_tools::run_command(command, Some(|exitcode|
|
||||
(exitcode & 0b0111) == 0 // only bits 0-2 are fatal errors
|
||||
))?;
|
||||
|
||||
let output: serde_json::Value = output.parse()?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user