moby/image
Wentao Zhang 4a014e6b0d Fix delete a image while saving it, delete successfully but failed to save it
Issue Description:
 * 1. Saving more than one images, `docker save -o a.tar aaa bbb`
 * 2. Delete the last image which in saving progress.  `docker rmi bbb`

Espected:
 Saving images operation shouldn't be disturbed. But the real result is that failed to
save image and get an error as below:
  `Error response from daemon: open
/var/lib/docker/image/devicemapper/imagedb/content/sha256/7c24e4d533a76e801662ad1b7e6e06bc1204f80110b5623e96ba2877c51479a1:
no such file or directory`

Analysis:
  1. While saving more than one images, it will get all the image info from reference/imagestore,
     and then using the `cached data` to save the images to a tar file.
  2. But this process doesn't have a resource lock, if a deletion operation comes, the image will be deleted,
     so saving operation will fail.

Solution:
 When begin to save an image, `Get` all the layers first. then the
deletion operation won't delete the layers.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
2017-06-01 18:13:20 +08:00
..
cache image/cache: fix isValidParent logic 2017-02-21 19:32:04 +01:00
spec some grammatical errors 2017-01-31 19:33:12 -08:00
tarexport Fix delete a image while saving it, delete successfully but failed to save it 2017-06-01 18:13:20 +08:00
v1 *: use opencontainers/go-digest package 2017-01-06 18:48:41 -08:00
fs.go Wrap errors in digest package so they are consistent between platforms. 2017-03-08 11:48:46 -05:00
fs_test.go Wrap errors in digest package so they are consistent between platforms. 2017-03-08 11:48:46 -05:00
image.go Fixing a typo in spelling 2017-03-30 14:31:45 +05:30
image_test.go Use assertions in image package unit tests. 2017-03-08 11:46:10 -05:00
rootfs.go Windows: Skip layers+base images 2016-09-07 12:16:45 -07:00
store.go *: use opencontainers/go-digest package 2017-01-06 18:48:41 -08:00
store_test.go Wrap errors in digest package so they are consistent between platforms. 2017-03-08 11:48:46 -05:00