public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] tools: smart: only throw error for smartctl fatal errors
@ 2021-08-31 13:48 Dominik Csapak
  2021-09-23 12:44 ` Dominik Csapak
  2021-09-27  7:03 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-08-31 13:48 UTC (permalink / raw)
  To: pbs-devel

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>
---
reported in the forum: https://forum.proxmox.com/threads/s-m-a-r-t-status-unknown.95417/

 src/tools/disks/smart.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tools/disks/smart.rs b/src/tools/disks/smart.rs
index b615603e..01054519 100644
--- a/src/tools/disks/smart.rs
+++ b/src/tools/disks/smart.rs
@@ -91,7 +91,9 @@ pub fn get_smart_data(
     };
     command.arg(disk_path);
 
-    let output = crate::tools::run_command(command, None)?;
+    let output = crate::tools::run_command(command, Some(|exitcode|
+        (exitcode & 0b0111) == 0 // only bits 0-2 are fatal errors
+    ))?;
 
     let output: serde_json::Value = output.parse()?;
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-27  7:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 13:48 [pbs-devel] [PATCH proxmox-backup] tools: smart: only throw error for smartctl fatal errors Dominik Csapak
2021-09-23 12:44 ` Dominik Csapak
2021-09-27  7:03 ` [pbs-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal