Commit Graph

450 Commits

Author SHA1 Message Date
778611a207 Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 65d79e3e5e537039b244afd7eda29e721a93d84f
Component: engine
2016-03-23 14:42:52 -07:00
8ddceeb099 Fix use of mounted() in overlay.
Handle error and mounted case separately.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 57ca2a210108d31f8cbe9660bcd6cd469a937ff7
Component: engine
2016-03-23 14:42:52 -07:00
fba90c19ef Revert "Move layer mount refcounts to mountedLayer"
This reverts commit 563d0711f83952e561a0d7d5c48fef9810b4f010.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e91de9fb9d175541acc95834de486d33feef552a
Component: engine
2016-03-23 00:33:02 -07:00
730efa6a55 Merge pull request #21107 from cpuguy83/one_ctr_to_rule_them_all
Move layer mount refcounts to mountedLayer
Upstream-commit: 92a3ece35a10092af0944f175a15b2390f6c666e
Component: engine
2016-03-22 21:19:00 -07:00
44acd43622 Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 563d0711f83952e561a0d7d5c48fef9810b4f010
Component: engine
2016-03-22 11:36:28 -04:00
bf213f3332 Remove unneeded references to execDriver
This includes:
 - updating the docs
 - removing dangling variables

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 8af4f89cba09105f3d581926aca6e231326f7054
Component: engine
2016-03-21 13:06:08 -07:00
ae0977f1d1 fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 0e025b4bb16c0d4cc6b3f0c040713d061b9b051a
Component: engine
2016-03-17 13:19:55 -07:00
f588ea4d9d Fix the assignment to wrong variable
We should be assigning value to minFreeMetadata instead of minFreeData. This
is copy/paste error.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 4141a00921e3ae814736249ec1806d5d35c8d46c
Component: engine
2016-03-17 15:19:08 +00:00
195d725261 *: fix response body leaks
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: f0d83c4cdb49adb53fdaf4216a4395c23d5cc8e9
Component: engine
2016-03-16 17:15:42 +01:00
fa85755ee7 Merge pull request #21097 from thaJeztah/dont-run-without-udev-sync
Fail when devicemapper doesn't support udev-sync
Upstream-commit: 37a1fadae6390e38da85d3fffe7a49e00de2830e
Component: engine
2016-03-14 21:18:01 -04:00
30dcca7468 Merge pull request #20786 from rhvgoyal/min-free-space
devmapper: Add a new option dm.min_free_space_percent
Upstream-commit: bfed97b6881393be51e81b97040f3874b61b8d72
Component: engine
2016-03-14 20:10:43 -04:00
78153006fc Make sure we call every graph init with the same root path.
Remove O(n^2) check for several prior configured drivers.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: ed6e33eedeaa6b7da44d3b0b3e2eac020b09277a
Component: engine
2016-03-11 17:15:55 -05:00
ed1cf843bd Fail when devicemapper doesn't support udev-sync
Now what we provide dynamic binaries for all plaforms,
we shouldn't try to run docker without udev sync support.

This change changes the previous warning to an Error,
unless the user explicitly overrides the warning, in
which case they're at their own risk.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: de641715105a116042ad9be5e1b2d1bb2962eb9c
Component: engine
2016-03-10 19:13:44 +01:00
e7b4b05653 devmapper: Add a new option dm.min_free_space
Once thin pool gets full, bad things can happen. Especially in case of xfs
it is possible that xfs keeps on retrying IO infinitely (for certain kind
of IO) and container hangs. 

One way to mitigate the problem is that once thin pool is about to get full,
start failing some of the docker operations like pulling new images or
creation of new containers. That way user will get warning ahead of time
and can try to rectify it by creating more free space in thin pool. This
can be done either by deleting existing images/containers or by adding more
free space to thin pool.

This patch adds a new option dm.min_free_space to devicemapper graph
driver. Say one specifies dm.min_free_space=10%. This means atleast
10% of data and metadata blocks should be free in pool before new device
creation is allowed, otherwise operation will fail.

By default min_free_space is 10%. User can change it by specifying
dm.min_free_space=X% on command line. A value of 0% will disable the
check.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 2e222f69b3486cf20039525a882ae4153b52f92c
Component: engine
2016-03-07 20:27:39 +00:00
9af5c681c5 Aufs: reduce redundant parsing of mountinfo
Check whether or not the file system type of a mountpoint is aufs
by calling statfs() instead of parsing mountinfo. This assumes
that aufs graph driver does not allow aufs as a backing file
system.

Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Upstream-commit: e8513675a20e2756e6c2915604605236d1a94d65
Component: engine
2016-03-04 11:39:59 +09:00
209e95dee8 Write Windows layer diffs to tar in standard format
Previously, Windows layer diffs were written using a Windows-internal
format based on the BackupRead/BackupWrite Win32 APIs. This caused
problems with tar-split and tarsum and led to performance problems
in implementing methods such as DiffPath. It also was just an
unnecessary differentiation point between Windows and Linux.

With this change, Windows layer diffs look much more like their
Linux counterparts. They use AUFS-style whiteout files for files
that have been removed, and they encode all metadata directly in
the tar file.

This change only affects Windows post-TP4, since changes to the Windows
container storage APIs were necessary to make this possible.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 5649030e25bd87b4b0bbd200515b8c7317ae8ce1
Component: engine
2016-03-02 16:13:40 -08:00
2d730b8156 Merge pull request #20475 from Microsoft/jstarks/filegetter
graphdriver: Replace DiffPath with DiffGetter
Upstream-commit: 8f109829e294371cbae1eebfc771eda96d92187f
Component: engine
2016-03-02 08:36:36 -08:00
395ec16335 graphdriver: Replace DiffPath with DiffGetter
This allows a graph driver to provide a custom FileGetter for tar-split
to use. Windows will use this to provide a more efficient implementation
in a follow-up change.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 58bec40d16265362fd4e41dbd652e6fba903794d
Component: engine
2016-03-01 10:25:33 -08:00
44ded729ad folders->directories
Signed-off-by: hsinko <21551195@zju.edu.cn>
Upstream-commit: 772f5495b7bb03a8fb97f9ae5fb5fa97c98a87b3
Component: engine
2016-02-29 21:32:30 -08:00
a63e28ad6f fix double-lock
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e386dfc33fc1fd5ed06496bd19f01a37c3c46341
Component: engine
2016-02-27 09:49:21 -05:00
f76950a71a Revert "Add finer-grained locking for aufs"
This reverts commit f31014197cbe9438cc956ed12c47093a0324c82d.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c2f7777603039b0e9b7e8fcdf517b1486dc14781
Component: engine
2016-02-27 08:01:19 -05:00
ac8b4b9a6a Add finer-grained locking for aufs
```
benchmark                       old ns/op       new ns/op     delta
BenchmarkConcurrentAccess-8     10269529748     26834747      -99.74%

benchmark                       old allocs     new allocs     delta
BenchmarkConcurrentAccess-8     309948         7232           -97.67%

benchmark                       old bytes     new bytes     delta
BenchmarkConcurrentAccess-8     23943576      1578441       -93.41%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f31014197cbe9438cc956ed12c47093a0324c82d
Component: engine
2016-02-25 18:06:41 -05:00
085a86e475 Fix some issues with concurrency in aufs.
Adds a benchmark to measure performance under concurrent actions.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 55c91f2ab9bcd48cfa248a4e842bb78257c14134
Component: engine
2016-02-25 14:32:13 -05:00
f62b97e499 Fix some typos in comments and strings
Most of them were found and fixed by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Upstream-commit: 2eee613326fb59fd168849618d14a9054a40f9f5
Component: engine
2016-02-22 20:27:15 +01:00
8271be384a Fix the typo
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: c33cdf9ee3ece0358f828c7ac8f6367c3414e67a
Component: engine
2016-02-16 07:00:01 +00:00
9a0f7a0e19 Add proper refcounting to zfs graphdriver
Fixes issues with layer remounting (e.g. a running container which then
has `docker cp` used to copy files in or out) by applying the same
refcounting implementation that exists in other graphdrivers like
overlay and aufs.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 922986b76e2ac596faed6a724cebcf7082174980
Component: engine
2016-02-11 01:00:54 -05:00
0b639e2753 Fixing 'docker save' on Windows.
Save was failing file integrity checksums due to bugs in both
Windows and Docker. This commit includes fixes to file time handling
in tarexport and system.chtimes that are necessary along with
the Windows platform fixes to correctly support save. With this
change, sysfile_backups for windowsfilter driver are no longer
needed, so that code is removed.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: 041a9510c671ecf4724bf15388fdb9de549b04ed
Component: engine
2016-02-08 18:08:49 -08:00
aac2fbc608 Merge pull request #20045 from estesp/zfs-userns-permissions-fix
Fix ZFS permissions bug with user namespaces
Upstream-commit: a93cb2b856381dcedbada4fc5b3d3855cfa32fb9
Component: engine
2016-02-05 15:32:43 -08:00
bbeb7c1fa4 Fix ZFS permissions bug with user namespaces
Fix root directory of the mountpoint being owned by real root. This is
unique to ZFS because of the way file mountpoints are created using the
ZFS tooling, and the remapping that happens at layer unpack doesn't
impact this root (already created) holding directory for the layer.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: aef0995b02a5a90ad74e6d91901d7bc8a9713796
Component: engine
2016-02-05 14:37:33 -05:00
f06d92067d Graphdriver/btrfs: Avoid using single d.Get()
For btrfs driver, in d.Create(), Get() of parentDir is called but not followed
by Put().

If we apply SElinux mount label, we need to mount btrfs subvolumes in d.Get(),
without a Put() would end up with a later Remove() failure on
"Device resourse is busy".

This calls the subvolume helper function directly in d.Create().

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Upstream-commit: b2e27fee53c269f9659bdab66852eaba4ffbe9c7
Component: engine
2016-02-04 10:25:24 -08:00
f7ee374e15 Remove case sensitive duplicate dir in vendor
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b9a395c85de3f4ea10810c8df789fc67e5b4b604
Component: engine
2016-02-03 13:06:32 -08:00
7aca59c08a Make btrfs call same interface as others
Most storage drivers call graphdriver.GetFSMagic(home),
it is more clean to easy to maintain. So btrfs need to
adopt such change.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
Upstream-commit: feda5d768439c6ecb8d3c82cee332724302e7cd2
Component: engine
2016-02-01 07:50:21 +00:00
6da2c320c6 Merge pull request #19216 from scaleoutsean/master
Add GPFS filesystem IDs
Upstream-commit: 67d86d10d890023eb6ceebfea2aaa8af937fd750
Component: engine
2016-01-22 21:27:03 -05:00
1136f541a5 Add GPFS
Signed-off-by: Sean Lee <seanlee@tw.ibm.com>
Upstream-commit: bdc8241da93fe13e1d451c37340ac9c9143bebe4
Component: engine
2016-01-22 21:12:47 +08:00
3dfe6e550f Merge pull request #19524 from LK4D4/iocopy_writeto
Use bufio.Reader in io.Copy source for overlay.copyRegular
Upstream-commit: d2448a0c201592f93996a807a416016914efaccd
Component: engine
2016-01-21 15:37:12 -05:00
091ca20c63 Use pools.Copy instead of io.Copy for overlay.copyRegular
That function is pretty heavy used on container start. Autoallocating
buffer can be painful.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 3f5e1c69b345b25d9b1c57f5d492a0e3fd4432a0
Component: engine
2016-01-21 08:53:37 -08:00
0b47135998 Revert "Copy aufs hardlinks to top layer"
This reverts commit ef05b83417e32f269daf798307adcf07fe6ef13f.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 98d0997894153df8f9cfc0783390cc80f6b0274a
Component: engine
2016-01-21 07:52:50 -08:00
3587269c45 Merge pull request #19123 from shishir-a412ed/rootfs_size_configurable
daemon option (--storage-opt dm.basesize) for increasing the base device size on daemon restart
Upstream-commit: 661d75f39858934c230c59a68d908ef203c34136
Component: engine
2016-01-13 13:22:08 -08:00
3baefd3b5b daemon option (--storage-opt dm.basesize) for increasing the base device size on daemon restart
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: e47112d3e812b90b240624711e7a5d2d203d6746
Component: engine
2016-01-13 13:57:31 -05:00
783a9aa06b Mark device ID free only if device actually got deleted
Right now if somebody has enabled deferred device deletion, then
deleteTransaction() returns success even if device could not be deleted. It
has been marked for deferred deletion. Right now we will mark device ID free
and potentially use it again when somebody tries to create new container. And
that's wrong. Device ID is not free yet. It will become free once devices
has actually been deleted by the goroutine later.

So move the location of call to markDeviceIDFree() to a place where we know
device actually got deleted and was not marked for deferred deletion.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 2dccb562dff79fef0f7a1d3b5f0e760e9d799d44
Component: engine
2016-01-11 18:57:37 +00:00
6c383a05bb Fix btrfs subvolume snapshot dir perms for user namespaces
Make sure btrfs mounted subvolumes are owned properly when a remapped
root exists (user namespaces are enabled, for example)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 72e65e87935e5b82de76a6ef9b8160900f4724b7
Component: engine
2016-01-07 23:05:28 -05:00
07c9d25d11 Merge pull request #19093 from estesp/userns-root-rework
Allow root non-userns metadata backwards compatibility
Upstream-commit: fe550a1f17f9ef65e03db65241378d8f89ef4525
Component: engine
2016-01-06 09:48:37 -08:00
647bd6865a Allow root non-userns metadata backwards compatibility
Instead of creating a "0.0" subdirectory and migrating graphroot
metadata into it when user namespaces are available in the daemon
(currently only in experimental), change the graphroot dir permissions
to only include the execute bit for "other" users.

This allows easy migration to and from user namespaces and will allow
easier integration of user namespace support into the master build.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: e8532023f20498e6eb1ce5c079dc8a09aeae3061
Component: engine
2016-01-05 11:51:14 -05:00
eb346ff358 Use direct filesystem access for tar-split on aufs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 0641429ad8a474c25eb99ee3c5a969b28baaad21
Component: engine
2016-01-04 09:41:02 -08:00
6e4bd4dbf1 Move graph driver registration out of the daemon package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 91154e9235c71bc120b93d2e16632970e0f0ce0e
Component: engine
2015-12-28 13:02:24 -05:00
2526161bde Remove the graph driver from the daemon, move it into the layer store.
Support restoreCustomImage for windows with a new interface to extract
the graph driver from the LayerStore.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f5916b10ae02c7db83052a97205ac345a3d96300
Component: engine
2015-12-28 12:55:48 -05:00
3ad8eda6ea ingnore the NotExist error when removing inexistent files
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: de7f6cf16be659cca9217ece6e5dc1221706d504
Component: engine
2015-12-25 15:19:48 +08:00
b064975176 Remove migrateIfDownlevel and aufs migration from docker pre-0.7
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0673361ef6a0439b79239efb000574ae991b84f7
Component: engine
2015-12-22 16:45:42 -05:00
8b5a2050f9 loopback: separate loop logic from devicemapper
The loopback logic is not technically exclusive to the devicemapper
driver. This reorganizes the code such that the loopback code is usable
outside of the devicemapper package and driver.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: af597527121c0ad973e9d0ae4f9cf970da1513cc
Component: engine
2015-12-18 10:57:43 -05:00
2d549dabbf Merge pull request #18686 from cpuguy83/fix_btrfs_subvol_delete_panic
Fix btrfs recursive btrfs subvol delete
Upstream-commit: f57d56350ecf02a88f38219f55cbc42c1a9e07b5
Component: engine
2015-12-16 14:26:40 -05:00