浏览代码

Fix overlay unmount for the root case

In root case no mount call or reference count
increment actually happens so don’t try to unmount.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Tonis Tiigi 8 年之前
父节点
当前提交
e4349ad901
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      daemon/graphdriver/overlay/overlay.go

+ 4 - 0
daemon/graphdriver/overlay/overlay.go

@@ -374,6 +374,10 @@ func (d *Driver) Get(id string, mountLabel string) (s string, err error) {
 
 // Put unmounts the mount path created for the give id.
 func (d *Driver) Put(id string) error {
+	// If id has a root, just return
+	if _, err := os.Stat(path.Join(d.dir(id), "root")); err == nil {
+		return nil
+	}
 	mountpoint := path.Join(d.dir(id), "merged")
 	if count := d.ctr.Decrement(mountpoint); count > 0 {
 		return nil