From 85db3f09bff68efb0a8509f7470b61604aefb447 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 19 Jul 2018 16:59:42 -0400 Subject: 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 --- cmd/podman/umount.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'cmd') 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") -} -- cgit v1.2.3-54-g00ecf