* [pbs-devel] applied [PATCH] api: disk list: do not fail but just log error on gathering smart data
@ 2024-11-17 19:32 Thomas Lamprecht
0 siblings, 0 replies; only message in thread
From: Thomas Lamprecht @ 2024-11-17 19:32 UTC (permalink / raw)
To: pbs-devel
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@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
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-17 19:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-17 19:32 [pbs-devel] applied [PATCH] api: disk list: do not fail but just log error on gathering smart data Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox