浏览代码

Always umount container rootfs and volumes on docker cp failed

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Lei Jitang 10 年之前
父节点
当前提交
13c36ce65e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      daemon/container.go

+ 3 - 2
daemon/container.go

@@ -622,11 +622,12 @@ func (container *Container) Copy(resource string) (io.ReadCloser, error) {
 		return nil, err
 	}
 	for _, m := range mounts {
-		dest, err := container.GetResourcePath(m.Destination)
+		var dest string
+		dest, err = container.GetResourcePath(m.Destination)
 		if err != nil {
 			return nil, err
 		}
-		if err := mount.Mount(m.Source, dest, "bind", "rbind,ro"); err != nil {
+		if err = mount.Mount(m.Source, dest, "bind", "rbind,ro"); err != nil {
 			return nil, err
 		}
 	}