[pbs-devel] applied [PATCH] api: disk list: do not fail but just log error on gathering smart data
Thomas Lamprecht
t.lamprecht at proxmox.com
Sun Nov 17 20:32:54 CET 2024
I plugged in a USB pen drive and the whole disk list UI became
completely unusable because smartctl fails to handle that device due
to some `Unknown USB bridge [0x090c:0x1000 (0x1100)]` error.
That itself might be improvable, but most often I do not care at all
about smart data, and certainly not enough to make failing gathering
it disallow me from viewing my disks (or the smart data from disks
where it still could be gathered, for that matter!)
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
src/tools/disks/mod.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs
index 9f47be36..6345fde7 100644
--- a/src/tools/disks/mod.rs
+++ b/src/tools/disks/mod.rs
@@ -1083,8 +1083,11 @@ fn get_disks(
let parallel_handler =
ParallelHandler::new("smartctl data", 4, move |device: (String, String)| {
- let smart_data = get_smart_data(Path::new(&device.1), false)?;
- tx.send((device.0, smart_data))?;
+ match get_smart_data(Path::new(&device.1), false) {
+ Ok(smart_data) => tx.send((device.0, smart_data))?,
+ // do not fail the whole disk output just because smartctl couldn't query one
+ Err(err) => log::error!("failed to gather smart data for {} – {err}", device.1),
+ }
Ok(())
});
--
2.39.5
More information about the pbs-devel
mailing list