Skip to content

Commit 30e60e0

Browse files
committed
storage: overlay: only unmount storage home if needed
Do not attempt to unmount storage home directory if we were not supposed to mount or remount it at all. This is never useful and may also break certain (unsupported) setups. Fixes: containers/podman#27012 Signed-off-by: Ivan Shapovalov <[email protected]>
1 parent 58b82c9 commit 30e60e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

storage/drivers/overlay/overlay.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,11 @@ func (d *Driver) Cleanup() error {
863863
if anyPresent {
864864
return nil
865865
}
866-
return mount.Unmount(d.home)
866+
// Ensure that we do not unmount anything not mounted by us
867+
if !d.options.skipMountHome {
868+
return mount.Unmount(d.home)
869+
}
870+
return nil
867871
}
868872

869873
// pruneStagingDirectories cleans up any staging directory that was leaked.

0 commit comments

Comments
 (0)