Skip to content

Commit

Permalink
blockdev: fix recognizing parent loop devices
Browse files Browse the repository at this point in the history
lsblk returns TYPE == loop for loop devices, modify the code
so loop devices are correctly recognized.
  • Loading branch information
ondrejbudai committed Jan 16, 2024
1 parent 0c47374 commit 082f25b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/blockdev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub(crate) fn find_parent_devices(device: &str) -> Result<Vec<String>> {
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());
Expand Down

0 comments on commit 082f25b

Please sign in to comment.