diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-07-19 16:59:42 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2018-07-19 17:01:07 -0400 |
commit | 85db3f09bff68efb0a8509f7470b61604aefb447 (patch) | |
tree | d3f8c2b92dde29066cb9c20fd79db4dc67a86f0e /cmd/podman/umount.go | |
parent | 98703eb204923f06555605c648fc165a55214520 (diff) | |
download | podman-85db3f09bff68efb0a8509f7470b61604aefb447.tar.gz podman-85db3f09bff68efb0a8509f7470b61604aefb447.tar.bz2 podman-85db3f09bff68efb0a8509f7470b61604aefb447.zip |
Let containers/storage keep track of mounts
Currently we unmount storage that is still in use.
We should not be unmounting storeage that we mounted
via a different command or by podman mount. This
change relies on containers/storage to umount keep track of
how many times the storage was mounted before really unmounting
it from the system.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/umount.go')
-rw-r--r-- | cmd/podman/umount.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/cmd/podman/umount.go b/cmd/podman/umount.go index 0fd7ff144..1a2cf22c6 100644 --- a/cmd/podman/umount.go +++ b/cmd/podman/umount.go @@ -58,7 +58,7 @@ func umountCmd(c *cli.Context) error { continue } - if err = unmountContainer(ctr); err != nil { + if err = ctr.Unmount(); err != nil { if lastError != nil { logrus.Error(lastError) } @@ -78,7 +78,7 @@ func umountCmd(c *cli.Context) error { continue } - if err = unmountContainer(ctr); err != nil { + if err = ctr.Unmount(); err != nil { if lastError != nil { logrus.Error(lastError) } @@ -90,12 +90,3 @@ func umountCmd(c *cli.Context) error { } return lastError } - -func unmountContainer(ctr *libpod.Container) error { - if mounted, err := ctr.Mounted(); mounted { - return ctr.Unmount() - } else { - return err - } - return errors.Errorf("container is not mounted") -} |