mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-02 00:00:03 +03:00
rust: suppress errors on fs probing
suppress errors for any non-bchfs blockdevs found during probing Signed-off-by: Alexander Fougner <fougner89@gmail.com>
This commit is contained in:
parent
87243efa5c
commit
bdc290eee0
@ -195,11 +195,16 @@ pub fn probe_filesystems() -> anyhow::Result<HashMap<Uuid, FileSystem>> {
|
||||
|
||||
// #[tracing_attributes::instrument(skip(dev, fs_map))]
|
||||
fn get_super_block_uuid(path: &std::path::Path) -> std::io::Result<std::io::Result<(Uuid, bcachefs::bch_sb_handle)>> {
|
||||
use gag::{BufferRedirect};
|
||||
// Stop libbcachefs from spamming the output
|
||||
let gag = BufferRedirect::stdout().unwrap();
|
||||
|
||||
let sb = bch_bindgen::rs::read_super(&path)?;
|
||||
let super_block = match sb {
|
||||
Err(e) => { return Ok(Err(e)); }
|
||||
Ok(sb) => sb,
|
||||
};
|
||||
drop(gag);
|
||||
|
||||
let uuid = (&super_block).sb().uuid();
|
||||
tracing::debug!(found="bcachefs superblock", devnode=?path, ?uuid);
|
||||
|
Loading…
Reference in New Issue
Block a user