From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] tools: smart: only throw error for smartctl fatal errors
Date: Tue, 31 Aug 2021 15:48:25 +0200 [thread overview]
Message-ID: <20210831134825.581949-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2021-08-31 13:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 13:48 Dominik Csapak [this message]
2021-09-23 12:44 ` Dominik Csapak
2021-09-27 7:03 ` [pbs-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210831134825.581949-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox