Commit Graph

552 Commits

Author SHA1 Message Date
467aa61392 Optimized debug print in the 'deviceset.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: 664ad19486b55a529ba2ba53b7d432b03dc5384a
Component: engine
2016-09-12 15:34:17 +08:00
30755d9f2c devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced
We just introduced a new tunable dm.xfs_nospace_max_retries. But this tunable
will work only on new kernels where xfs supports this feature. On older
kernels xfs does not allow tuning this behavior.

There are two issues. First one is that if xfsSetNospaceRetries() fails,
it returns error but leaves the device activated and mounted. We should
be unmounting the device and deactivate it before returning.
 
Second issue is, if docker is started on older kernel, with
dm.xfs_nospace_max_retries specified, then docker will silently ignore the
fact that /sys file to tweak this behavior is not present and will continue.
But I think it might be better to fail container creation/start if kernel
does not support this feature.

This patch fixes it. After this patch, user will get an error like following
when container is run.

# docker run -ti fedora bash
docker: Error response from daemon: devmapper: user specified daemon option dm.xfs_nospace_max_retries but it does not seem to be supported on this system :open /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries: no such file or directory.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 6cc55dd65b363fe520c2ab29a9303f79afd4cadb
Component: engine
2016-09-07 14:03:01 -04:00
f9ef0edaad devmapper: Provide a knob dm.xfs_nospace_max_retries
When xfs filesystem is being used on top of thin pool, xfs can get ENOSPC
errors from thin pool when thin pool is full. As of now xfs retries the
IO and keeps on retrying and does not give up. This can result in container
application being stuck for a very long time. In fact I have seen instances
of unkillable processes. So that means once thin pool is full and process
gets stuck, container can't be stopped/killed either and only option left
seems to be power recycle of the box.

In another instance, writer did not block but failed after a while. But
when I tried to exit/stop the container, unmounting xfs hanged and only
thing I could do was power cycle the machine.

Now upstream kernel has committed patches where it allows user space to
customize user space behavior in case of errors. One of the knobs is
max_retries, which specifies how many times an IO should be retried
when ENOSPC is encountered.

This patch sets provides a tunable knob (dm.xfs_nospace_max_retries) so
that user can specify value for max_retries and tune xfs behavior. If
one sets this value to 0, xfs will not retry IO when ENOSPC error is
encountered. It will instead give up and shutdown filesystem.

This knob can be useful if one is running into unkillable
processes/containers issue on top of xfs.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 4f0017b9ad7dfa2e9dcdee69d000b98595893e60
Component: engine
2016-09-01 11:38:09 -04:00
670946bf76 Avoid fork on mount for overlay2 in common case
In the common case where the user is using /var/lib/docker and
an image with less than 60 layers, forking is not needed. Calculate
whether absolute paths can be used and avoid forking to mount in
those cases.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c13a985fa1196a5ed782d5ac68a4bbb68dd529ca
Component: engine
2016-08-22 11:43:10 -07:00
0f2f3d0378 Merge pull request #25746 from lixiaobing10051267/masterName
wrong id when testing exists in daemon aufs
Upstream-commit: d7753dceb814e92c20a067df51fd231fe2d0fda9
Component: engine
2016-08-16 13:00:03 -04:00
060a7d7824 wrong id when testing exists in daemon aufs
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: cdb6c59eda4e78d626721a6a38fd305a6d2c50f3
Component: engine
2016-08-16 16:42:45 +08:00
cc5b6aa3dd Don't create devices if in a user namespace
If we are running in a user namespace, don't try to mknod as
it won't be allowed.  libcontainer will bind-mount the host's
devices over files in the container anyway, so it's not needed.

The chrootarchive package does a chroot (without mounting /proc) before
its work, so we cannot check /proc/self/uid_map when we need to.  So
compute it in advance and pass it along with the tar options.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Upstream-commit: 617c352e9225b1d598e893aa5f89a8863808e4f2
Component: engine
2016-08-12 16:26:58 -04:00
1dbc55e6ff Merge pull request #25509 from Microsoft/jjh/23079
Windows: Block ReFS file systems
Upstream-commit: 34cc19f6702c23b2ae4aad2b169ca64154404f9f
Component: engine
2016-08-12 09:32:22 -07:00
fe7b1d72f0 Merge pull request #23391 from Microsoft/WindowsSandboxSize
Windows: Added support for storage-opt size
Upstream-commit: 04e021d7511fcfdc0838a0165f70a4772c0e7718
Component: engine
2016-08-09 15:34:39 +02:00
a4fc4e13d8 Windows: Block ReFS file systems
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1cb9e9b44e7140d14dd42d48b2a7c038b65e8f16
Component: engine
2016-08-08 14:30:37 -07:00
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
85d966380c Windows: Added support for storage-opt size
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 7e5ee6d176357fb294d0ca7b9a93373f6cc84bc0
Component: engine
2016-06-21 10:53:29 -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