docker/daemon/graphdriver
Shishir Mahajan 0e633ee14a Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Problem Description:

An example scenario that involves deferred removal
1. A new base image gets created (e.g. 'docker load -i'). The base device is activated and
mounted at some point in time during image creation.
2. While image creation is in progress, a privileged container is started
from another image and the host's mount name space is shared with this
container ('docker run --privileged -v /:/host').
3. Image creation completes and the base device gets unmounted. However,
as the privileged container still holds a reference on the base image
mount point, the base device cannot be removed right away. So it gets
flagged for deferred removal.
4. Next, the privileged container terminates and thus its reference to the
base image mount point gets released. The base device (which is flagged
for deferred removal) may now be cleaned up by the device-mapper. This
opens up an opportunity for a race between a 'kworker' thread (executing
the do_deferred_remove() function) and the Docker daemon (executing the
CreateSnapDevice() function).

This PR cancel the deferred removal, if the device is marked for it. And reschedule the
deferred removal later after the device is resumed successfully.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-08-02 10:33:58 -04:00
..
aufs small nit: fix unmeaningful log 2016-07-26 07:10:28 +08:00
btrfs
devmapper Fixes Issue # 23418: Race condition between device deferred removal and resume device. 2016-08-02 10:33:58 -04:00
graphtest Update diff apply test to check sub directories 2016-07-26 12:03:55 -07:00
overlay
overlay2 Allow option to override kernel check in overlay2 2016-07-11 16:48:08 -07:00
register
vfs
windows fix typos 2016-07-23 11:32:23 +08:00
zfs Merge pull request #24745 from daehyeok/logrus 2016-07-28 16:50:19 -07:00
counter.go
driver.go use %s instead of %q when format in graphdirver log 2016-07-30 02:12:55 +08:00
driver_freebsd.go
driver_linux.go
driver_solaris.go Refactoring for logrus formatting 2016-07-18 12:53:34 -06:00
driver_unsupported.go
driver_windows.go
fsdiff.go
plugin.go
plugin_unsupported.go
proxy.go