Skip to content

Commit c3d595c

Browse files
committed
blockdev: fix recognizing parent loop devices
lsblk returns TYPE == loop for loop devices, modify the code so loop devices are correctly recognized. Signed-off-by: Ondřej Budai <[email protected]>
1 parent e5b5970 commit c3d595c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/blockdev.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub(crate) fn find_parent_devices(device: &str) -> Result<Vec<String>> {
197197
let kind = dev
198198
.get("TYPE")
199199
.with_context(|| format!("device in hierarchy of {device} missing TYPE"))?;
200-
if kind == "disk" {
200+
if kind == "disk" || kind == "loop" {
201201
parents.push(name.clone());
202202
} else if kind == "mpath" {
203203
parents.push(name.clone());

0 commit comments

Comments
 (0)