Browse Source

Merge pull request #23067 from shishir-a412ed/fix_commit_issue

Fixes Issue # 22992: docker commit failing
Michael Crosby 9 years ago
parent
commit
b1f8b45b8f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      daemon/graphdriver/devmapper/driver.go

+ 2 - 2
daemon/graphdriver/devmapper/driver.go

@@ -160,8 +160,9 @@ func (d *Driver) Remove(id string) error {
 // Get mounts a device with given id into the root filesystem
 func (d *Driver) Get(id, mountLabel string) (string, error) {
 	mp := path.Join(d.home, "mnt", id)
+	rootFs := path.Join(mp, "rootfs")
 	if count := d.ctr.Increment(mp); count > 1 {
-		return mp, nil
+		return rootFs, nil
 	}
 
 	uid, gid, err := idtools.GetRootUIDGID(d.uidMaps, d.gidMaps)
@@ -186,7 +187,6 @@ func (d *Driver) Get(id, mountLabel string) (string, error) {
 		return "", err
 	}
 
-	rootFs := path.Join(mp, "rootfs")
 	if err := idtools.MkdirAllAs(rootFs, 0755, uid, gid); err != nil && !os.IsExist(err) {
 		d.ctr.Decrement(mp)
 		d.DeviceSet.UnmountDevice(id, mp)