aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Fougner <fougner89@gmail.com>2023-01-15 21:57:04 +0100
committerAlexander Fougner <fougner89@gmail.com>2023-01-15 22:20:16 +0100
commitbdc290eee061d1989059f5a4be10b87c0348bf6f (patch)
tree7d52eee94b3e3de15843b217ea58fd68c739600d
parent87243efa5c792f72be0bcea2fdf0c4335d59c2ec (diff)
downloadbcachefs-tools-bdc290eee061d1989059f5a4be10b87c0348bf6f.tar.gz
rust: suppress errors on fs probing
suppress errors for any non-bchfs blockdevs found during probing Signed-off-by: Alexander Fougner <fougner89@gmail.com>
-rw-r--r--rust-src/mount/src/filesystem.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/rust-src/mount/src/filesystem.rs b/rust-src/mount/src/filesystem.rs
index b1575c26..89865bc4 100644
--- a/rust-src/mount/src/filesystem.rs
+++ b/rust-src/mount/src/filesystem.rs
@@ -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);