5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-03-05 20:58:33 +03:00

api: disk list: do not fail but just log error on gathering smart data

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>
This commit is contained in:
Thomas Lamprecht 2024-11-17 20:28:51 +01:00
parent 936ec6b69e
commit 4983a3c0ba

View File

@ -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(())
});