瀏覽代碼

fix Put without Get in aufs

this Patch is ported from 3916561619d45a3d8ca17dfa467149824111023a

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Liu Hua 9 年之前
父節點
當前提交
451f751773
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      daemon/graphdriver/aufs/aufs.go

+ 8 - 0
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 {