Skip to content

Commit

Permalink
fix(device_remove): close bdev during device removal for spdk bdev
Browse files Browse the repository at this point in the history
Signed-off-by: Diwakar Sharma <[email protected]>
  • Loading branch information
dsharma-dc committed Nov 29, 2023
1 parent e9bbfcb commit 670fd33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions io-engine/src/bdev/nexus/nexus_bdev_children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,15 @@ impl<'n> Nexus<'n> {
nexus_name,
child_device, "Unplugging nexus child device",
);
// The child could be open in case of spdk bdev child. Close
// the child here so that the unplug
// correctly identifies the child device
// as destroying. In case of a child fault, we'd reach here
// via retiral path and child must be
// closed already.
if child.is_opened() {
child.close().await.ok();
}
child.unplug();
}
None => {
Expand Down

0 comments on commit 670fd33

Please sign in to comment.