Browse Source

Merge pull request #27753 from tonistiigi/fix-overlay-unmount

Fix overlay unmount for the root case
Michael Crosby 8 years ago
parent
commit
1883b73a57
1 changed files with 4 additions and 0 deletions
  1. 4 0
      daemon/graphdriver/overlay/overlay.go

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

@@ -389,6 +389,10 @@ func (d *Driver) Get(id string, mountLabel string) (s string, err error) {
 
 
 // Put unmounts the mount path created for the give id.
 // Put unmounts the mount path created for the give id.
 func (d *Driver) Put(id string) error {
 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")
 	mountpoint := path.Join(d.dir(id), "merged")
 	if count := d.ctr.Decrement(mountpoint); count > 0 {
 	if count := d.ctr.Decrement(mountpoint); count > 0 {
 		return nil
 		return nil