Commit Graph

541 Commits

Author SHA1 Message Date
1e0e8f732e 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>
Upstream-commit: 0e633ee14aca32480ac4735675222c35f4e11d8c
Component: engine
2016-08-02 10:33:58 -04:00
658a5f6d39 use %s instead of %q when format in graphdirver log
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: dec4481e08179bb9fa9ae5adc5b8aa14f2fb5087
Component: engine
2016-07-30 02:12:55 +08:00
488d786bb3 Merge pull request #24745 from daehyeok/logrus
Refactoring for logrus formatting
Upstream-commit: 170abb5f7cabf4921a378d76532e74a272fbe39c
Component: engine
2016-07-28 16:50:19 -07:00
8ab2988832 Update diff apply test to check sub directories
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 5c05b8447d06793530e3d860b99a6e878685275a
Component: engine
2016-07-26 12:03:55 -07:00
7804833e8f Merge pull request #24997 from WeiZhang555/fix-unmeaningful-log
small nit: fix unmeaningful log
Upstream-commit: 19ec73b8b5e08d24edcd0eb886fa514d2678741a
Component: engine
2016-07-25 10:33:57 -04:00
5d53107934 small nit: fix unmeaningful log
Truncated dir name can't give any useful information, print whole dir
name will.

Bad debug log is like this:

```
DEBU[2449] aufs error unmounting /var/lib/doc: no such file or directory
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: af8359562c9561afad0a05e66386588d17788804
Component: engine
2016-07-26 07:10:28 +08:00
1c3431e16a fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 4e959ef2f7f063803d04e06166f459257eb94b5c
Component: engine
2016-07-23 11:32:23 +08:00
ae77cef214 Create zfs directory if it doesn't exist at startup.
Signed-off-by: Damian Smyth <damian@dsau.co>
Upstream-commit: 205bc6fc99872ba852fa7a158c106514d5b64179
Component: engine
2016-07-19 10:12:22 +10:00
d3ae6c280d Refactoring for logrus formatting
Use module name logrus instead of log.
Use logrus.[Error|Warn|Debug|Fatal|Panic|Info]f instead of w/o f

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 6a1183b3ae512961f41a8ccfc8205e08294216f4
Component: engine
2016-07-18 12:53:34 -06:00
a5531ff991 Allow option to override kernel check in overlay2
Add option to skip kernel check for older kernels which have been patched to support multiple lower directories in overlayfs.

Fixes #24023

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: ff98da0607c4d6a94a2356d9ccaa64cc9d7f6a78
Component: engine
2016-07-11 16:48:08 -07:00
5590093d90 Removing Custom Images support
Now that Windows base images can be loaded directly into docker via "docker load" of a specialized tar file (with docker pull support on the horizon) we no longer have need of the custom images code path that loads images from a shared central location.  Removing that code and it's call points.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: 3e109f349ff42ea1a0f555b6e645c51d9bc1539b
Component: engine
2016-07-07 14:56:37 -07:00
6bcf7ca500 Merge pull request #24091 from AkihiroSuda/fixZFS24008
zfs: call mount.MakePrivate
Upstream-commit: b8cef7c19cea0f4ee670a9362154716b2313a18f
Component: engine
2016-06-30 11:14:30 -07:00
e667b026a1 Add detail error logs when 'Unknown Device' error happens if devicemapper storage is used.
Signed-off-by: yuzou <zouyu7@huawei.com>
Upstream-commit: d4a2bcc9ac49d07c71822ce72b97861d5844b46d
Component: engine
2016-06-30 13:06:14 +08:00
ed5060064e zfs: call mount.MakePrivate
Fix #24008

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 5ec8441bb55ecbf83da6407a4135ce83b1fe01c7
Component: engine
2016-06-29 01:55:45 +00:00
860c6cce0c overlay2: close read end of pipe on mount exec
Use StdinPipe to ensure pipe is properly closed after startup

Fixes #23686

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: ad4b3e11fe41080d66ac1780b455246ae18bdc35
Component: engine
2016-06-28 13:23:00 -07:00
066b0582fe Fix overlay2 ignoring whiteout files
Currently when overlay creates a whiteout file then the overlay2 layer is archived,
the correct tar header will be created for the whiteout file, but the tar logic will then attempt to open the file causing a failure.
When tar encounters such failures the file is skipped and excluded for the archive, causing the whiteout to be ignored.
By skipping the copy of empty files, no open attempt will be made on whiteout files.

Fixes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: bd13c53f8dc1504c9e681dfabef2afc1685ccec7
Component: engine
2016-06-23 13:34:38 -07:00
d903446499 fix "overlay" -> "overlay2" in error message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2d4b285a75621604f31058a43cb5ef1d4618533e
Component: engine
2016-06-16 16:42:40 -07:00
8d1c8c8149 Merge pull request #23515 from HackToday/fixoverlay2
Add ecryptfs check for overlay2
Upstream-commit: 06da8ce28582417cd93d3242f1d895e46d4a204e
Component: engine
2016-06-16 15:12:09 -07:00
3c08c9d8dd Merge pull request #23446 from tiborvass/plugins-experimental
Plugins: experimental support for new plugin management
Upstream-commit: 6ed921dc38be582939966f71a01ec10f03ed531f
Component: engine
2016-06-14 20:32:14 -04:00
848e510213 plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: f37117045c5398fd3dca8016ea8ca0cb47e7312b
Component: engine
2016-06-14 14:20:27 -07:00
2ebabdf47f Remove symlinks on layer removal for overlay2
Symlinks are currently not getting cleaned up when removing layers since only the root directory is removed.
On remove, read the link file and remove the associated link from the link directory.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: e6f2e7646c813e8225b0bc16d3a0c13c76a9cd97
Component: engine
2016-06-14 12:40:35 -07:00
250b4af05c Add ecryptfs check for overlay2
We added docs about ecryptfs check but not in code side.
Also refactor code to make it clean.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: 136323b04315eceffbed61d680878ed23cecc015
Component: engine
2016-06-14 14:25:52 +00:00
56c2250686 Merge pull request #23501 from dmcgowan/fix-overlay-diff-test
Remove failing overlay test
Upstream-commit: 31e48e85ef929f2b2b232f4c971f7c7966002539
Component: engine
2016-06-14 10:49:42 +02:00
9edf6c9627 Merge pull request #23490 from shishir-a412ed/dm_options_modularized
Modularize dm.use_deferred_removal and dm.use_deferred_deletion logic.
Upstream-commit: c69614deae7f20e0dbff8399ce3a8d11014b0f43
Component: engine
2016-06-14 08:47:43 +02:00
44db465ebc Remove failing overlay test
Diff apply is sometimes producing a different change list causing the tests to fail.
Overlay has a known issue calculating diffs of files which occur within the same second they were created.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 0e74aabbb9aa5cea0b6bf7342f9e325f989468fa
Component: engine
2016-06-13 22:34:57 -07:00
7bec8a2e7d Merge pull request #22126 from dmcgowan/overlay-native-diff
Overlay multiple lower directory support
Upstream-commit: 8a2f9a249c28c0a80bac4b41eb318dfe68f63f0d
Component: engine
2016-06-13 13:15:39 -07:00
19552d6875 Modularize dm.use_deferred_removal and dm.use_deferred_deletion logic.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: cac6658da061f01b4abd5b4bd1a7aeb234e8401d
Component: engine
2016-06-13 12:05:46 -04:00
04ae4edf2f Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a72b45dbec3caeb3237d1af5aedd04adeb083571
Component: engine
2016-06-11 13:16:55 -07:00
763e6c326e *: fix logrus.Warn[f]
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 44ccbb317c2ca67fd8a88147b1ff80ce83d453cc
Component: engine
2016-06-11 19:42:38 +02:00
c6851cb49f Add separate overlay2 driver
Adds a new overlay driver which uses multiple lower directories to create the union fs.
Additionally it uses symlinks and relative mount paths to allow a depth of 128 and stay within the mount page size limit.
Diffs and done directly over a single directory allowing diffs to be done efficiently and without the need fo the naive diff driver.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 23e5c94cfb26eb72c097892712d3dbaa93ee9bc0
Component: engine
2016-06-08 00:16:01 -07:00
025e93c7bd Add more overlay tests and benchmarks
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 246e99303195b6ce4c357ceb5925990aa1890288
Component: engine
2016-06-08 00:16:01 -07:00
75e59286ce Expand graphtest package
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 8b0441d42cca4f89cf871c1b64172cc06f9c98e6
Component: engine
2016-06-08 00:16:01 -07:00
5b4a1181e1 Merge pull request #21946 from chosenken/add_disk_quota_to_zfs
Add support for setting storage size on ZFS containers
Upstream-commit: d85491ff4bd300b159425dcad41764f454f43ceb
Component: engine
2016-06-07 22:18:25 -04:00
5578aba972 Merge pull request #23193 from allencloud/fix-typos
use grep to find all a/an typos
Upstream-commit: 98c245c9e63793cf8ca03c5500e0820447c1861c
Component: engine
2016-06-02 18:45:08 -07:00
ce5b5efc4f Merge pull request #23121 from unclejack/disallow_ecryptfs_aufs
aufs,overlay: disable on eCryptfs
Upstream-commit: 22aca92ee3503f811f813be4a1349ad8e67fbbdb
Component: engine
2016-06-02 12:54:43 +02:00
35c5774373 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: c1be45fa38e82054dcad606d71446a662524f2d5
Component: engine
2016-06-02 17:17:22 +08:00
e85968bd52 aufs,overlay: disable on eCryptfs
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 5e85ec82af6c8ec70ed39fd8489aea730fd41561
Component: engine
2016-06-01 21:00:35 +03:00
2360dea0b4 graphtest: fix cleanup logic
device Base should not exists on failure:

--- FAIL: TestDevmapperCreateBase (0.06s)
    graphtest_unix.go:122: stat
/tmp/docker-graphtest-079240530/devicemapper/mnt/Base/rootfs/a subdir:
no such file or directory
--- FAIL: TestDevmapperCreateSnap (0.00s)
    graphtest_unix.go:219: devmapper: device Base already
exists.

it should be:

--- FAIL: TestDevmapperCreateBase (0.25s)
	graphtest_unix.go:122: stat
/tmp/docker-graphtest-828994195/devicemapper/mnt/Base/rootfs/a subdir:
no such file or directory
--- FAIL: TestDevmapperCreateSnap (0.13s)
	graphtest_unix.go:122: stat
/tmp/docker-graphtest-828994195/devicemapper/mnt/Snap/rootfs/a subdir:
no such file or directory

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: b18062122d76a9f53822889874aa12103d491372
Component: engine
2016-05-31 20:08:57 +02:00
98b281fb61 Windows: fix Windows graph driver name
Reverting "Windows filter storage driver" to "windowsfilter".

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: f182748b9b7d639c4db09f4f72411aba5f811f4e
Component: engine
2016-05-27 16:24:02 -07:00
bd261166b3 Fixes Issue # 22992: docker commit failing.
1) docker create / run / start: this would create a snapshot device and mounts it onto the filesystem.
So the first time GET operation is called. it will create the rootfs directory and return the path to rootfs
2) Now when I do docker commit. It will call the GET operation second time. This time the refcount will check
that the count > 1 (count=2). so the rootfs already exists, it will just return the path to rootfs.

Earlier it was just returning the mp: /var/lib/docker/devicemapper/mnt/{ID} and hence the inconsistent paths error.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 09d0720e2fb6e30ee018887399f353f93ac2d421
Component: engine
2016-05-27 14:35:46 -04:00
b39fa693a7 Merge branch 'master' into b
Upstream-commit: 59bb86a964c38d0f2cc724c686803472bb48968b
Component: engine
2016-05-24 21:43:45 -04:00
b5619754dc fixed spelling error in windows.go
Signed-off-by: Nirmal Mehta <nirmalkmehta@gmail.com>
Upstream-commit: 36a9151b27168076073770142d0b354f0e83fdb2
Component: engine
2016-05-24 21:40:08 -04:00
d767f40c10 Merge pull request #22948 from dmcgowan/remove-unused-overlay-mounted
Remove unused mounted function in overlay
Upstream-commit: 0802401d22790ec85a620ac1c1ee41f81025c4a8
Component: engine
2016-05-24 13:08:06 -07:00
12513175c8 Merge pull request #22091 from amitkris/build_solaris
Get the Docker Engine to build clean on Solaris
Upstream-commit: 86a7632d63bdddb95aaf1472648056a4fb737d38
Component: engine
2016-05-24 21:41:36 +02:00
1bdae7f37d Remove unused mounted function in overlay
The mount check is now done by the FSChecker. This function is no longer needed and shouldn't be called.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 5cc082473068b00dee123f8388a79d7a48842a57
Component: engine
2016-05-24 11:02:07 -07:00
2736991181 Remove mountedLayer Mount and Unmount
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 8bb4d31b10e4c3abee9ca92535461859bbf25d46
Component: engine
2016-05-23 16:52:58 -07:00
3a35464d9d Get the Docker Engine to build clean on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: 86d8758e2bb5e9d21d454ceda90b33feb8e74771
Component: engine
2016-05-23 16:37:12 -07:00
de30361155 Fix overlay use of rootdir and defer
Check for the rootDir first because the mergeDir may not exist if root
is present.

Also fix unmounting in the defer to make sure it does not have a
refcount.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 36a82c20321936a71b30fcfde8bc6c76d6cc8d1f
Component: engine
2016-05-23 16:03:40 -07:00
bfa2eac673 Add windows graph driver ref counter
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 4bac8bce985b20d68422ef93de3adf4931b2dee5
Component: engine
2016-05-23 16:03:40 -07:00
987aa6f79e Add reference counting to aufs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5b6b8df0c1b5a54ae9a717810eedf9fc971e1321
Component: engine
2016-05-23 15:57:23 -07:00