summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-07-30 09:04:18 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-01 17:53:30 +0000
commit8e1ef558eb324767ac46e452c80cc79f7ba2e9d2 (patch)
treeedfbbf2dee75ef08a7eb1a4139e3f2da3cf27ecf /libpod/container_internal.go
parenta8ae7eae9c9e545b685abfd1e42a2a63cb547a80 (diff)
downloadpodman-8e1ef558eb324767ac46e452c80cc79f7ba2e9d2.tar.gz
podman-8e1ef558eb324767ac46e452c80cc79f7ba2e9d2.tar.bz2
podman-8e1ef558eb324767ac46e452c80cc79f7ba2e9d2.zip
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
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 66d1e44ad..7b5932541 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -839,7 +839,7 @@ func (c *Container) cleanupStorage() error {
return nil
}
- if err := c.unmount(); err != nil {
+ if err := c.unmount(false); err != nil {
// If the container has already been removed, warn but don't
// error
// We still want to be able to kick the container out of the
@@ -1338,9 +1338,9 @@ func (c *Container) mount() (string, error) {
}
// unmount unmounts the container's root filesystem
-func (c *Container) unmount() error {
+func (c *Container) unmount(force bool) error {
// Also unmount storage
- if _, err := c.runtime.storageService.UnmountContainerImage(c.ID()); err != nil {
+ if _, err := c.runtime.storageService.UnmountContainerImage(c.ID(), force); err != nil {
return errors.Wrapf(err, "error unmounting container %s root filesystem", c.ID())
}