Skip to content

Commit

Permalink
fs: remove all contents in mount-point after un-mount
Browse files Browse the repository at this point in the history
  • Loading branch information
xtexx committed Jan 4, 2025
1 parent f3b1581 commit aacbf1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fs/overlayfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl OverlayManager for OverlayFS {
}
info!("overlayfs: un-mounting at {:?}", self.target);
umount2(&self.target, MntFlags::MNT_DETACH)?;
fs::remove_dir(&self.target)?;
fs::remove_dir_all(&self.target)?;
self.upper.unmount()?;
for lower in &self.lower {
lower.unmount()?;
Expand Down
2 changes: 1 addition & 1 deletion src/fs/tmpfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Layer for TmpfsLayer {
}
info!("tmpfs: un-mounting at {:?}", self.target);
umount2(&self.target, MntFlags::MNT_DETACH)?;
fs::remove_dir(&self.target)?;
fs::remove_dir_all(&self.target)?;
Ok(())
}
}
Expand Down

0 comments on commit aacbf1b

Please sign in to comment.