Add --force to podman umount to force the unmounting of the rootfs

podman umount will currently only unmount file system if not other
process is using it, otherwise the umount decrements the container
storage to indicate that the caller is no longer using the mount
point, once the count gets to 0, the file system is actually unmounted.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1184
Approved by: TomSweeneyRedHat
This commit is contained in:
Daniel J Walsh
2018-07-30 09:04:18 -04:00
committed by Atomic Bot
parent a8ae7eae9c
commit 8e1ef558eb
6 changed files with 54 additions and 11 deletions

View File

@ -441,7 +441,7 @@ func (c *Container) Mount() (string, error) {
}
// Unmount unmounts a container's filesystem on the host
func (c *Container) Unmount() error {
func (c *Container) Unmount(force bool) error {
if !c.batched {
c.lock.Lock()
defer c.lock.Unlock()
@ -469,7 +469,7 @@ func (c *Container) Unmount() error {
return errors.Wrapf(err, "can't unmount %s last mount, it is still in use", c.ID())
}
}
return c.unmount()
return c.unmount(force)
}
// Pause pauses a container