From aa4b811b507c71dd32d6bbdd8c6e2f82bd489ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Sat, 9 Dec 2023 11:22:48 +0100 Subject: [PATCH] blockdev: fix recognizing parent loop devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lsblk returns TYPE == loop for loop devices, modify the code so loop devices are correctly recognized. Signed-off-by: Ondřej Budai --- lib/src/blockdev.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/blockdev.rs b/lib/src/blockdev.rs index e9a76519b..329d3ddc2 100644 --- a/lib/src/blockdev.rs +++ b/lib/src/blockdev.rs @@ -197,7 +197,7 @@ pub(crate) fn find_parent_devices(device: &str) -> Result> { let kind = dev .get("TYPE") .with_context(|| format!("device in hierarchy of {device} missing TYPE"))?; - if kind == "disk" { + if kind == "disk" || kind == "loop" { parents.push(name.clone()); } else if kind == "mpath" { parents.push(name.clone());