fix Put without Get in aufs

this Patch is ported from 3916561619d45a3d8ca17dfa467149824111023a

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 451f7517733087a8629fe20894b6c10a63bb155e
Component: engine
This commit is contained in:
Liu Hua
2015-12-03 22:22:25 +08:00
parent 5e25f840c3
commit 8c2653fb9a
@@ -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 {