summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-07-19 16:59:42 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2018-07-19 17:01:07 -0400
commit85db3f09bff68efb0a8509f7470b61604aefb447 (patch)
treed3f8c2b92dde29066cb9c20fd79db4dc67a86f0e /cmd
parent98703eb204923f06555605c648fc165a55214520 (diff)
downloadpodman-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')
-rw-r--r--cmd/podman/umount.go13
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")
-}