From 8c2653fb9ac4803e10f7ede7339e9eece414708a Mon Sep 17 00:00:00 2001 From: Liu Hua Date: Tue, 1 Dec 2015 17:19:34 +0800 Subject: [PATCH] fix Put without Get in aufs this Patch is ported from 3916561619d45a3d8ca17dfa467149824111023a Signed-off-by: Liu Hua Upstream-commit: 451f7517733087a8629fe20894b6c10a63bb155e Component: engine --- components/engine/daemon/graphdriver/aufs/aufs.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/engine/daemon/graphdriver/aufs/aufs.go b/components/engine/daemon/graphdriver/aufs/aufs.go index 0cb5a053d6..aa24185ff4 100644 --- a/components/engine/daemon/graphdriver/aufs/aufs.go +++ b/components/engine/daemon/graphdriver/aufs/aufs.go @@ -332,6 +332,14 @@ func (a *Driver) Put(id string) error { m := a.active[id] if m == nil { + // but it might be still here + if a.Exists(id) { + path := path.Join(a.rootPath(), "mnt", id) + err := Unmount(path) + if err != nil { + logrus.Debugf("Failed to unmount %s aufs: %v", id, err) + } + } return nil } if count := m.referenceCount; count > 1 {