Commit Graph

436 Commits

Author SHA1 Message Date
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
4738f86f62 Merge pull request #18682 from calavera/replace_units_package
Replace pkg/units with docker/go-units.
Upstream-commit: b44b5bbc8ba48f50343602a21e7d44c017c1e23d
Component: engine
2015-12-16 10:48:59 -08:00
3d517a11e5 Replace pkg/units with docker/go-units.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 4fef42ba206ac90346e6e0fe25bead3f77dc4b0f
Component: engine
2015-12-16 12:26:49 -05:00
91750ca308 reorder imports with goimports
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: baba1a84935bd2114d48f1f4823ee9c379d62e68
Component: engine
2015-12-16 16:50:25 +01:00
341415cdcb Fix btrfs recursive btrfs subvol delete
Really fixing 2 things:

1. Panic when any error is detected while walking the btrfs graph dir on
removal due to no error check.
2. Nested subvolumes weren't actually being removed due to passing in
the wrong path

On point 2, for a path detected as a nested subvolume, we were calling
`subvolDelete("/path/to/subvol", "subvol")`, where the last part of the
path was duplicated due to a logic error, and as such actually causing
point #1 since `subvolDelete` joins the two arguemtns, and
`/path/to/subvol/subvol` (the joined version) doesn't exist.

Also adds a test for nested subvol delete.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f9befce2d38614de3dfa474bc0f2e1b9937a8ca2
Component: engine
2015-12-15 18:12:40 -05:00
bc2d1566f2 devmapper: store base device fs type
After the very first init of the graph `docker info` correctly shows the
base fs type under `Backing Filesystem`. This information isn't stored
anywhere. After a restart (w/o erasing `/var/lib/docker`) `docker info`
shows an empty string under `Backing Filesystem`.
This patch records the base fs type after the first run in the metadata
or, to fix old devices that don't have this info in the metadata, just
probe the fs type of the base device at graph startup.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: f22ee02c6d6bd16f2179e71366ec641a7d234e96
Component: engine
2015-12-15 09:33:19 +01:00
f1d7c7a10b Make daemon/graphdriver/devmapper log messages with a common, consistent prefix.
Closes #16667

Uses the prefix "devmapper:" for all the fmt and logrus error, debug, and info messages.

Signed-off-by: Chris Dituri <csdituri@gmail.com>
Upstream-commit: 0aa6ace6e6e819551d21ebdcaa0c5802f76d7603
Component: engine
2015-12-14 21:35:13 -06:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
1aaaffc214 Fixed typo change deivce to device.
This changes deivce to device in daemon, test and docs.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 7c077c2c3443fdb9b13b7790bc96cdaa287cf381
Component: engine
2015-12-10 15:23:05 -06:00
cb952213f7 devmapper: remove unused var
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 037cbcec989f7867b6062455e8b042b8d2b0ab18
Component: engine
2015-12-10 08:28:02 +01:00
6021acc699 Fix overlay and user namespace permissions
All underlay dirs need proper remapped ownership. This bug was masked by the
fact that the setupInitLayer code was chown'ing the dirs at startup
time. Since that bug is now fixed, it revealed this permissions issue.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 191cefbaca45ba86341379d09d2f75d5fc1868fb
Component: engine
2015-12-08 14:28:28 -05:00
8c2653fb9a fix Put without Get in aufs
this Patch is ported from 3916561619d45a3d8ca17dfa467149824111023a

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 451f7517733087a8629fe20894b6c10a63bb155e
Component: engine
2015-12-03 22:22:25 +08:00
5e25f840c3 Fix Put without Get in devicemapper
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: f7bdb973578a08a5012c741e4ebb262d2dd81165
Component: engine
2015-12-03 22:22:25 +08:00
b17c4f91f6 devmapper: Log start and end of filesystem creation
ext4 filesystem creation can take a long time on 100G thin device and
systemd might time out and kill docker service. Often user is left thinking
why docker is taking so long and logs don't give any hint. Log an info
message in journal for start and end of filesystem creation. That way
a user can look at logs and figure out that filesystem creation is
taking long time.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: a489e685c0d17455463945316cfe366e4e65dca6
Component: engine
2015-12-01 13:05:46 +00:00
e105a29374 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4352da7803d182a6013a5238ce20a7c749db979a
Component: engine
2015-11-24 09:40:25 -08:00