Commit Graph

796 Commits

Author SHA1 Message Date
5a20e1240c LCOW: Fix OpenFile parameters
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 141b9a74716c016029badf16aca21dc96975aaac
Component: engine
2018-01-17 07:58:18 -08:00
4a656e30d0 Improve zfs init log message for zfs
Signed-off-by: Drew Hubl <drew.hubl@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 27b002f4a02e2d9f6eded9004b82cb81f121264f
Component: engine
2018-01-16 21:42:05 -05:00
d7084e8097 Merge pull request #35638 from cpuguy83/error_helpers2
Add helpers to create errdef errors
Upstream-commit: c36274da8326c59aaa12c48196671b41dcb89e5b
Component: engine
2018-01-15 10:56:46 -08:00
621388138c Golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b4a63139696aea2c73ec361a9af8b36a118f0423
Component: engine
2018-01-15 00:42:25 +01:00
d4d0b5c268 Move api/errdefs to errdefs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d453fe35b9b8b52d0677fe0c3cc8373f2f5d30d0
Component: engine
2018-01-11 21:21:43 -05:00
58f87a5e9a Cleanup graphdriver/quota test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e3a6323419c8b2a81a21134ed49a1624eb483c81
Component: engine
2018-01-08 13:41:45 -05:00
f1638ade2e Merge pull request #35674 from kolyshkin/zfs-rmdir
zfs: fix ebusy on umount etc
Upstream-commit: daded8da9178ec097e59a6b0b2bf12754b5472d8
Component: engine
2017-12-28 15:35:19 -08:00
0a947da27f Merge pull request #35827 from kolyshkin/vfs-quota
Fix VFS vs quota regression
Upstream-commit: 3e1df952b7d693ac3961f492310852bdf3106240
Component: engine
2017-12-22 12:32:03 -06:00
f0d368cb33 vfs gd: ignore quota setup errors
This is a fix to regression in vfs graph driver introduced by
commit 7a1618ced359a3ac92 ("add quota support to VFS graphdriver").

On some filesystems, vfs fails to init with the following error:

> Error starting daemon: error initializing graphdriver: Failed to mknod
> /go/src/github.com/docker/docker/bundles/test-integration/d6bcf6de610e9/root/vfs/backingFsBlockDev:
> function not implemented

As quota is not essential for vfs, let's ignore (but log as a warning) any error
from quota init.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 1e8a087850aa9f96c5000a3ad90757d2e9c0499f
Component: engine
2017-12-19 13:55:04 -08:00
c5f1cdf92c projectquota: treat ENOSYS as quota unsupported
If mknod() returns ENOSYS, it most probably means quota is not supported
here, so return the appropriate error.

This is a conservative* fix to regression in vfs graph driver introduced
by commit 7a1618ced359a3ac92 ("add quota support to VFS graphdriver").
On some filesystems, vfs fails to init with the following error:

> Error starting daemon: error initializing graphdriver: Failed to mknod
> /go/src/github.com/docker/docker/bundles/test-integration/d6bcf6de610e9/root/vfs/backingFsBlockDev:
> function not implemented

Reported-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 2dd39b7841bdb9968884bbedc5db97ff77d4fe3e
Component: engine
2017-12-18 10:32:36 -08:00
fd08bae89c Remove redundant build-tags
Files that are suffixed with `_linux.go` or `_windows.go` are
already only built on Linux / Windows, so these build-tags
were redundant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6ed1163c98703f8dd0693cecbadc84d2cda811c3
Component: engine
2017-12-18 17:41:53 +01:00
feccd72a49 Fix overlay2 storage driver inside a user namespace
The overlay2 driver was not setting up the archive.TarOptions field
properly like other storage backend routes to "applyTarLayer"
functionality. The InUserNS field is populated now for overlay2 using
the same query function used by the other storage drivers.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 05b8d59015f8a5ce26c8bbaa8053b5bc7cb1a77b
Component: engine
2017-12-13 23:38:22 -05:00
ef0d4a2bec devmapper: Log fstype and mount options during mount error
Right now we only log source and destination (and demsg) if mount operation
fails. fstype and mount options are available easily. It probably is a good
idea to log these as well. Especially sometimes failures can happen due to
mount options.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f728d74ac5d185adaa5f1a88eadc71217806859f
Component: engine
2017-12-11 13:27:14 -05:00
e8e8613267 Merge pull request #35514 from thaJeztah/disable-overlay-without-d_type
Remove support for overlay/overlay2 without d_type
Upstream-commit: bd8a9c25ee257384ca24cf32e61b6b0ef71f521d
Component: engine
2017-12-06 14:13:58 -08:00
0ec86524ed fixed typo (reliablity -> reliability)
Signed-off-by: Jihyun Hwang <jhhwang@telcoware.com>
Upstream-commit: 518c50c9b21225ee991d5147cccb687ea8640afc
Component: engine
2017-12-06 09:51:53 +09:00
0c8a47d019 Allow existing setups to continue using d_type
Even though it's highly discouraged, there are existing
installs that are running overlay/overlay2 on filesystems
without d_type support.

This patch allows the daemon to start in such cases, instead of
refusing to start without an option to override.

For fresh installs, backing filesystems without d_type support
will still cause the overlay/overlay2 drivers to be marked as
"unsupported", and skipped during the automatic selection.

This feature is only to keep backward compatibility, but
will be removed at some point.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0a4e793a3da9ba6d20bccfb83f7c48e20a76d895
Component: engine
2017-12-04 18:41:25 -08:00
327b80ad82 Merge pull request #35537 from sargun/vfs-use-copy_file_range
Have VFS graphdriver use accelerated in-kernel copy
Upstream-commit: 4047cede65862aa0ea5616297d7c0f3b12526ad4
Component: engine
2017-12-04 19:34:56 -06:00
e4dde67875 Remove support for overlay/overlay2 without d_type
Support for running overlay/overlay2 on a backing filesystem
without d_type support (most likely: xfs, as ext4 supports
this by default), was deprecated for some time.

Running without d_type support is problematic, and can
lead to difficult to debug issues ("invalid argument" errors,
or unable to remove files from the container's filesystem).

This patch turns the warning that was previously printed
into an "unsupported" error, so that the overlay/overlay2
drivers are not automatically selected when detecting supported
storage drivers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0abb8dec3f730f3ad2cc9a161c97968a6bfd0631
Component: engine
2017-12-04 17:10:20 -08:00
403fcf5047 Perform fsmagic detection on driver's home-dir if it exists
The fsmagic check was always performed on "data-root" (`/var/lib/docker`),
not on the storage-driver's home directory (e.g. `/var/lib/docker/<somedriver>`).

This caused detection to be done on the wrong filesystem in situations
where `/var/lib/docker/<somedriver>` was a mount, and a different
filesystem than `/var/lib/docker` itself.

This patch checks if the storage-driver's home directory exists, and only
falls back to `/var/lib/docker` if it doesn't exist.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f9c8fa305e1501d8056f8744cb193a720aab0e13
Component: engine
2017-12-04 17:10:07 -08:00
f1cfd038e2 zfs: fix ebusy on umount
This commit is a set of fixes and improvement for zfs graph driver,
in particular:

1. Remove mount point after umount in `Get()` error path, as well
   as in `Put()` (with `MNT_DETACH` flag). This should solve "failed
   to remove root filesystem for <ID> .... dataset is busy" error
   reported in Moby issue 35642.

To reproduce the issue:

   - start dockerd with zfs
   - docker run -d --name c1 --rm busybox top
   - docker run -d --name c2 --rm busybox top
   - docker stop c1
   - docker rm c1

Output when the bug is present:
```
Error response from daemon: driver "zfs" failed to remove root
filesystem for XXX : exit status 1: "/sbin/zfs zfs destroy -r
scratch/docker/YYY" => cannot destroy 'scratch/docker/YYY':
dataset is busy
```

Output when the bug is fixed:
```
Error: No such container: c1
```
(as the container has been successfully autoremoved on stop)

2. Fix/improve error handling in `Get()` -- do not try to umount
   if `refcount` > 0

3. Simplifies unmount in `Get()`. Specifically, remove call to
   `graphdriver.Mounted()` (which checks if fs is mounted using
   `statfs()` and check for fs type) and `mount.Unmount()` (which
   parses `/proc/self/mountinfo`). Calling `unix.Unmount()` is
   simple and sufficient.

4. Add unmounting of driver's home to `Cleanup()`.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a450a575a672b90f02a4b1d3d9300ce1d70a6311
Component: engine
2017-12-01 13:46:47 -08:00
20a2865e53 Fix setting mtimes on directories
Previously, the code would set the mtime on the directories before
creating files in the directory itself. This was problematic
because it resulted in the mtimes on the directories being
incorrectly set. This change makes it so that the mtime is
set only _after_ all of the files have been created.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 77a2bc3e5bbc9be3fe166ed8321b7cd04e7bd097
Component: engine
2017-12-01 09:12:43 -08:00
87f648cd90 Merge pull request #35618 from kolyshkin/mkdir-all
Fix MkdirAll* and its usage
Upstream-commit: 72e45fd54e13256c813fdb39b18e26a0de980733
Component: engine
2017-11-30 11:19:29 -05:00
a88b24bfeb Merge pull request #35483 from thaJeztah/disallow-nfs-backing-for-overlay
Disallow overlay/overlay2 on top of NFS
Upstream-commit: bdd9668b489c65eb1ef7272d38ad877ffda2041c
Component: engine
2017-11-29 19:24:58 -08:00
006ed302fe Merge pull request #35527 from thaJeztah/feature-detect-overlay2
Detect overlay2 support on pre-4.0 kernels
Upstream-commit: 11e07e7da6023b872788b1e05f83e147f0984fb2
Component: engine
2017-11-29 13:51:26 -08:00
87cfb875f7 Merge pull request #34948 from euank/public-mounts
Fix EBUSY errors under overlayfs and v4.13+ kernels
Upstream-commit: 09eb7bcc3624f5bd70135d6d24021b40c1095b46
Component: engine
2017-11-29 12:48:39 +09:00
877f5d0f1f Fix bug, where copy_file_range was still calling legacy copy
There was a small issue here, where it copied the data using
traditional mechanisms, even when copy_file_range was successful.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 0eac562281782257e6f69d58bcbc13fa889f1759
Component: engine
2017-11-28 14:59:56 -08:00
608a03b9d5 Have VFS graphdriver use accelerated in-kernel copy
This change makes the VFS graphdriver use the kernel-accelerated
(copy_file_range) mechanism of copying files, which is able to
leverage reflinks.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: d2b71b26604370620630d8d3f35aba75ae474f3f
Component: engine
2017-11-28 14:59:56 -08:00
85f5db8154 Fix copying hardlinks in graphdriver/copy
Previously, graphdriver/copy would improperly copy hardlinks as just regular
files. This patch changes that behaviour, and instead the code now keeps
track of inode numbers, and if it sees the same inode number again
during the copy loop, it hardlinks it, instead of copying it.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: b467f8b2ef21dc2239dcd136a29283ea6c3a0aee
Component: engine
2017-11-28 14:59:56 -08:00
efd7b774aa Detect overlay2 support on pre-4.0 kernels
The overlay2 storage-driver requires multiple lower dir
support for overlayFs. Support for this feature was added
in kernel 4.x, but some distros (RHEL 7.4, CentOS 7.4) ship with
an older kernel with this feature backported.

This patch adds feature-detection for multiple lower dirs,
and will perform this feature-detection on pre-4.x kernels
with overlayFS support.

With this patch applied, daemons running on a kernel
with multiple lower dir support will now select "overlay2"
as storage-driver, instead of falling back to "overlay".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 955c1f881ac94af19c99f0f7d5635e6a574789f2
Component: engine
2017-11-28 13:55:33 -08:00
2ddb9ceeba Merge pull request #35528 from thaJeztah/ignore-empty-graphdirs
Skip empty directories on prior graphdriver detection
Upstream-commit: 9ae697167c8b90b40d5248e99a8f0a0fc304637e
Component: engine
2017-11-27 17:37:39 -08:00
bc89af9929 Simplify/fix MkdirAll usage
This subtle bug keeps lurking in because error checking for `Mkdir()`
and `MkdirAll()` is slightly different wrt to `EEXIST`/`IsExist`:

 - for `Mkdir()`, `IsExist` error should (usually) be ignored
   (unless you want to make sure directory was not there before)
   as it means "the destination directory was already there"

 - for `MkdirAll()`, `IsExist` error should NEVER be ignored.

Mostly, this commit just removes ignoring the IsExist error, as it
should not be ignored.

Also, there are a couple of cases then IsExist is handled as
"directory already exist" which is wrong. As a result, some code
that never worked as intended is now removed.

NOTE that `idtools.MkdirAndChown()` behaves like `os.MkdirAll()`
rather than `os.Mkdir()` -- so its description is amended accordingly,
and its usage is handled as such (i.e. IsExist error is not ignored).

For more details, a quote from my runc commit 6f82d4b (July 2015):

    TL;DR: check for IsExist(err) after a failed MkdirAll() is both
    redundant and wrong -- so two reasons to remove it.

    Quoting MkdirAll documentation:

    > MkdirAll creates a directory named path, along with any necessary
    > parents, and returns nil, or else returns an error. If path
    > is already a directory, MkdirAll does nothing and returns nil.

    This means two things:

    1. If a directory to be created already exists, no error is
    returned.

    2. If the error returned is IsExist (EEXIST), it means there exists
    a non-directory with the same name as MkdirAll need to use for
    directory. Example: we want to MkdirAll("a/b"), but file "a"
    (or "a/b") already exists, so MkdirAll fails.

    The above is a theory, based on quoted documentation and my UNIX
    knowledge.

    3. In practice, though, current MkdirAll implementation [1] returns
    ENOTDIR in most of cases described in #2, with the exception when
    there is a race between MkdirAll and someone else creating the
    last component of MkdirAll argument as a file. In this very case
    MkdirAll() will indeed return EEXIST.

    Because of #1, IsExist check after MkdirAll is not needed.

    Because of #2 and #3, ignoring IsExist error is just plain wrong,
    as directory we require is not created. It's cleaner to report
    the error now.

    Note this error is all over the tree, I guess due to copy-paste,
    or trying to follow the same usage pattern as for Mkdir(),
    or some not quite correct examples on the Internet.

    [1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 516010e92d56cfcd6d1e343bdc02b6f04bc43039
Component: engine
2017-11-27 17:32:12 -08:00
7830091c4b graphdriver/overlay{,2}: remove 'merged' on umount
This removes and recreates the merged dir with each umount/mount
respectively.
This is done to make the impact of leaking mountpoints have less
user-visible impact.

It's fairly easy to accidentally leak mountpoints (even if moby doesn't,
other tools on linux like 'unshare' are quite able to incidentally do
so).

As of recently, overlayfs reacts to these mounts being leaked (see

One trick to force an unmount is to remove the mounted directory and
recreate it. Devicemapper now does this, overlay can follow suit.

Signed-off-by: Euan Kemp <euan.kemp@coreos.com>
Upstream-commit: af0d589623eff9f8cefced8b527dbd7cf221ce61
Component: engine
2017-11-22 14:32:30 -08:00
cb2dc1cb0b graphdriver/overlay: minor doc comment cleanup
Signed-off-by: Euan Kemp <euan.kemp@coreos.com>
Upstream-commit: 1e214c09524c0cf32c3e8005631bbcf3e1afa506
Component: engine
2017-11-22 14:17:08 -08:00
a653d42fdb Skip empty directories on prior graphdriver detection
When starting the daemon, the `/var/lib/docker` directory
is scanned for existing directories, so that the previously
selected graphdriver will automatically be used.

In some situations, empty directories are present (those
directories can be created during feature detection of
graph-drivers), in which case the daemon refuses to start.

This patch improves detection, and skips empty directories,
so that leftover directories don't cause the daemon to
fail.

Before this change:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, aufs; Please cleanup or explicitly choose storage driver (-s <DRIVER>)

With this patch applied:

    $ mkdir /var/lib/docker /var/lib/docker/aufs /var/lib/docker/overlay2
    $ dockerd
    ...
    INFO[2017-11-16T17:26:43.207739140Z] Docker daemon                                 commit=ab90bc296 graphdriver(s)=overlay2 version=dev
    INFO[2017-11-16T17:26:43.208033095Z] Daemon has completed initialization

And on restart (prior graphdriver is still picked up):

    $ dockerd
    ...
    INFO[2017-11-16T17:27:52.260361465Z] [graphdriver] using prior storage driver: overlay2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1262c57714e694193be6bbcbed83e859dc246c2f
Component: engine
2017-11-21 15:42:04 +01:00
d0d7235731 Remove deprecated MkdirAllAs(), MkdirAs()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 38b3af567f676c4c35e80e493aa97b7346ae75e4
Component: engine
2017-11-21 13:53:54 +01:00
23f0e9211c Merge pull request #35522 from kolyshkin/gd-custom
graphdriver: custom build-time priority list
Upstream-commit: edc204b1ffd53252649917fe54daa0b8419ed4ec
Component: engine
2017-11-17 15:48:26 -08:00
94aae8ab65 Skip further checks for quota in user namespaces
Commit 7a1618ced359a3ac921d8a05903d62f544ff17d0 regresses running Docker
in user namespaces. The new check for whether quota are supported calls
NewControl() which in turn calls makeBackingFsDev() which tries to
mknod(). Skip quota tests when we detect that we are running in a user
namespace and return ErrQuotaNotSupported to the caller. This just
restores the status quo.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Upstream-commit: 7e35df0e0484118740dbf01e7db9b482a1827ef1
Component: engine
2017-11-17 12:57:27 +01:00
0db60dff81 graphdriver: custom build-time priority list
Add a way to specify a custom graphdriver priority list
during build. This can be done with something like

  go build -ldflags "-X github.com/docker/docker/daemon/graphdriver.priority=overlay2,devicemapper"

As ldflags are already used by the engine build process, and it seems
that only one (last) `-ldflags` argument is taken into account by go,
an envoronment variable `DOCKER_LDFLAGS` is introduced in order to
be able to append some text to `-ldflags`. With this in place,
using the feature becomes

  make DOCKER_LDFLAGS="-X github.com/docker/docker/daemon/graphdriver.priority=overlay2,devicemapper" dynbinary

The idea behind this is, the priority list might be different
for different distros, so vendors are now able to change it
without patching the source code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 17708e72a7ef29fb1d4b03fbded1c5e4c08105fd
Component: engine
2017-11-16 19:43:34 -08:00
ce594a83b1 daemon/graphdriver/register: separate overlay2
Make it possible to disable overlay and overlay2 separately.

With this commit, we now have `exclude_graphdriver_overlay` and
`exclude_graphdriver_overlay2` build tags for the engine, which
is in line with any other graph driver.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d014be5426c869d429c1a11cad9e76321dd7a326
Component: engine
2017-11-15 00:06:00 -08:00
4bd3446b2b Merge pull request #35231 from sargun/add-vfs-quota-support
Add vfs quota support
Upstream-commit: 0defc6981322e16863e068f99b98326394b8cbd0
Component: engine
2017-11-14 15:05:02 +00:00
2ca8cee39b Disallow overlay/overlay2 on top of NFS
From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt:

> The lower filesystem can be any filesystem supported by Linux and does
> not need to be writable. The lower filesystem can even be another
> overlayfs. The upper filesystem will normally be writable and if it
> is it must support the creation of trusted.* extended attributes, and
> must provide valid d_type in readdir responses, so NFS is not suitable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 90dfb1d0cc59d79ccb272997d735864615010785
Component: engine
2017-11-13 23:24:23 +01:00
3e8332108b Merge pull request #34573 from cyphar/dm-dos-prevention-remove-mountpoint
devicemapper: remove container rootfs mountPath after umount
Upstream-commit: bbc4f78ba9c77f5a2e177c69870efed0eb7e8ba2
Component: engine
2017-11-08 17:08:07 +01:00
95cc30e089 devmapper: add a test for mount leak workaround
In order to avoid reverting our fix for mount leakage in devicemapper,
add a test which checks that devicemapper's Get() and Put() cycle can
survive having a command running in an rprivate mount propagation setup
in-between. While this is quite rudimentary, it should be sufficient.

We have to skip this test for pre-3.18 kernels.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 1af8ea681fba1935c60c11edbbe19b894c9b286f
Component: engine
2017-11-08 11:02:11 +11:00
bab1ef9f35 Add quota support to VFS graphdriver
This patch adds the capability for the VFS graphdriver to use
XFS project quotas. It reuses the existing quota management
code that was created by overlay2 on XFS.

It doesn't rely on a filesystem whitelist, but instead
the quota-capability detection code.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 7a1618ced359a3ac921d8a05903d62f544ff17d0
Component: engine
2017-11-06 15:53:51 -08:00
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
c0bf3ebcc8 Merge pull request #35177 from sargun/add-quota-tests
Add tests to project quotas and detection mechanism
Upstream-commit: 226eb8004e0e9b1cd55b37ce4c235c0f19ca9a14
Component: engine
2017-10-30 21:08:38 +01:00
320e3a6526 Add tests to project quotas and detection mechanism
This adds a mechanism (read-only) to check for project quota support
in a standard way. This mechanism is leveraged by the tests, which
test for the following:
 1. Can we get a quota controller?
 2. Can we set the quota for a particular directory?
 3. Is the quota being over-enforced?
 4. Is the quota being under-enforced?
 5. Can we retrieve the quota?

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 6966dc0aa9134c518babcbf1f02684cae5374843
Component: engine
2017-10-27 11:07:37 -07:00
b238ed565f Improve devicemapper driver-status output
Do not print "Data file" and "Metadata file" if they're
not used, and sort/group output.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8f702de9b705ced68b6244239ac81d86ebdd6b0a
Component: engine
2017-10-27 10:12:39 +02:00
373458dd9c Merge pull request #34670 from sargun/use_copy_file_range
Use In-kernel File Copy for Overlayfs and VFS on Linux
Upstream-commit: ce5800c329510bbf38c6899c3386633823acefcd
Component: engine
2017-10-25 17:10:44 +02:00
a04c3458dc Add zero-copy support to copy module
This changeset allows Docker's VFS, and Overlay to take advantage of
Linux's zerocopy APIs.

The copy function first tries to use the ficlone ioctl. Reason being:
 - they do not allow partial success (aka short writes)
 - clones are expected to be a fast metadata operation
See: http://oss.sgi.com/archives/xfs/2015-12/msg00356.html

If the clone fails, we fall back to copy_file_range, which internally
may fall back to splice, which has an upper limit on the size
of copy it can perform. Given that, we have to loop until the copy
is done.

For a given dirCopy operation, if the clone fails, we will not try
it again during any other file copy. Same is true with copy_file_range.

If all else fails, we fall back to traditional copy.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 3ec4ec2857c714387e7b59c2cf324565f6ae55e2
Component: engine
2017-10-24 13:14:40 -07:00