Commit Graph

331 Commits

Author SHA1 Message Date
67663efaad devmapper: Use deactivateDevice() instead of removeDevice() in deleteDevice()
Use deactivateDevice() instead of removeDevice() directly. This will make
sure for device deletion, deferred removal is used if user has configured
it in. Also this makes reading code litle easier as there is single function
to remove a device and that is deactivateDevice().

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 39081eb3aa8f715c1da6f798c6531efd7a8a494c
Component: engine
2015-09-30 18:54:06 -04:00
7fb23fc9ef devmapper: Fail device deletion early if device is still mounted
If a device is still mounted at the time of DeleteDevice(), that means
higher layers have not called Put() properly on the device and are trying
to delete it. This is a bug in the code where Get() and Put() have not been
properly paired up. Fail device deletion if it is still mounted.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: e97e46b7376c3195383636d305d832b2ba3f82c5
Component: engine
2015-09-30 15:21:22 -04:00
91a056571d devmapper: Fix comments and for HasDevice() and Exists()
Exists() and HasDevice() just check if device file exists or not. It does
not say anything about if device is mounted or not. Fix comments.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f5c0eb9ffe9a9d30ac6ff81fa1a4c216908189a6
Component: engine
2015-09-30 15:21:22 -04:00
9dabe752c1 devmapper: Do not load transaction meta file in device Hash map
device has map (device.Devices), contains valid devices and we skip all
the files which are not device files. transaction metadata file is not
device file. Skip this file when devices files are being read and loaded
into map.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: ba02bf31cbffe329e549516e0004cf113ab4517e
Component: engine
2015-09-30 15:21:22 -04:00
eb95300866 Fix golint issues on the windows graph driver.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 1fffc7a89dd69800317e881009188871906cce6a
Component: engine
2015-09-29 18:32:45 -04:00
87c29288c8 Try to resize data and metadata loopback file when initiating devicemapper
Signed-off-by: Chun Chen <ramichen@tencent.com>
Upstream-commit: 2458452a3b96d0e6f6dfa44d7c30585db83c2fd1
Component: engine
2015-09-24 09:31:00 +08:00
05ac4217a0 Lint package pkg/devicemapper
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6990b76a696dd265674f4c2973f25755a6485f05
Component: engine
2015-09-05 23:15:13 +02:00
743472f299 Warning message for lvm devmapper running on top of loopback devices
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 4870fb36d4ab1ef221cdcd95644cb19f6da0217a
Component: engine
2015-08-31 10:35:48 -04:00
eeab72d8f5 Typo fix then -> than
Signed-off-by: Miguel Morales <mimoralea@hp.com>
Upstream-commit: 95e3a4ca6d7635e11d606a1011e0a55146c68460
Component: engine
2015-08-28 10:44:39 -05:00
5b4a0b8a4c cleanup and fix btrfs subvolume recursion deletion
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: bd06432ba32a6cc555de82e08b125992aaec25fb
Component: engine
2015-08-25 13:00:41 -07:00
488804ae00 fix 9939: docker does not remove btrfs subvolumes when destroying container
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: dea78fc2ce9d7a2cf24b79f8625a06dbd74403a2
Component: engine
2015-08-24 14:52:07 -07:00
84c411f6f2 Merge pull request #15735 from tonistiigi/graph-register-readcloser
Make graph.Register take in io.Reader
Upstream-commit: 1544c5edb6fc796918a0bc2968a48df4e23a9fdb
Component: engine
2015-08-24 10:40:04 -07:00
427f147704 Merge pull request #15708 from Microsoft/sjw/graphdriver_missing_parent
Windows: Graphdriver should reject create of layer w/o parent
Upstream-commit: 90801ab9398d80576003d31255dd08613393b741
Component: engine
2015-08-21 16:34:03 -07:00
0e5e69219f Windows: Graphdriver should reject create of layer w/o parent
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: a456f20b44637b861740a7dd0102073f6390c452
Component: engine
2015-08-21 13:23:04 -07:00
d84f50c157 Make graph.Register take in io.Reader
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 2d1158790dc56df6d2b39a9c94acf34d62299b91
Component: engine
2015-08-20 20:37:11 -07:00
3b6efefc4b Merge pull request #14928 from brahmaroutu/lint_daemon_graphdriver
daemon/graphdriver fix lint errors/warnings
Upstream-commit: 90ebc3b455c93490c3886aaa491c7e67b7b1ec48
Component: engine
2015-08-20 03:25:00 -07:00
49b3bfecf2 deviceset.go: fixed link in warning about udex sync is not supported
Signed-off-by: Laszlo Meszaros <lacienator@gmail.com>
Upstream-commit: 78676f19c1939ad984c809ed81db665adf1576f5
Component: engine
2015-08-19 14:16:40 +02:00
d3fcc3f0db daemon/graphdriver fix lint errors/warnings
Addresses #14756

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 9e1a41aae53a9f9fb260c3666db2d4228ea4f50b
Component: engine
2015-08-17 19:27:36 +00:00
73f39654a9 Windows: Graph remove custom interface and add central store
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>

Windows: add support for images stored in alternate location.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: dfbb5520e3b35030f3eef38d5a2d86ad20ea0a2f
Component: engine
2015-08-14 23:45:53 -07:00
baa28c0e1c graphdriver/zfs: fix GetMetadata() comment
Commit e27c904 added a wrong and misleading comment
to GetMetadata(). Fix it using the wording from
commit 407a626 which introduced GetMetadata().

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Upstream-commit: 15a232fd06e062f8aae4e89e1f520f44c875daeb
Component: engine
2015-08-11 18:16:11 -07:00
9192baac2d graphdriver/zfs: privatize mountPath and zfsPath
These functions are not part of the graphdriver.Driver
interface and should therefore be private.

Also, remove comments added by commit e27c904 as they are
* pretty obvious
* no longer required by golint

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Upstream-commit: f5f7fee2ecc964314b2a7b910fda71a157c90f16
Component: engine
2015-08-11 18:16:08 -07:00
cbeaee68d7 Merge pull request #15422 from kolyshkin/graphtest-fix
graphtest: filter out lost+found dir entry
Upstream-commit: 0bfad28b867a8dc4d20a15c73588672ae861eaab
Component: engine
2015-08-10 12:21:21 -07:00
7a08f892e2 Merge pull request #15404 from vbatts/vbatts-dm-zero-sized-field
devicemapper: fix zero-sized field access
Upstream-commit: 6f89a8ee1ba6b598dc1f76e829d6db6f830cdb8e
Component: engine
2015-08-10 09:16:11 -07:00
48bf8fcaf6 devicemapper: fix zero-sized field access
Fixes: #15279

Due to
7904946eeb
the devices field is dropped.

This solution works on go1.4 and go1.5

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: f83d05c3be3c3bcc84f6fa229504848ee8078321
Component: engine
2015-08-10 11:11:58 -04:00
8120b4d8fe Change all docker -d to docker daemon
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 81cc8ebc93c20537d5fab4c016a3774f58b3e483
Component: engine
2015-08-10 20:48:08 +08:00
280de502d3 graphtest: filter out lost+found dir entry
Ploop graph driver provides its own ext4 filesystem to every
container. It so happens that ext4 root comes with lost+found
directory, causing failures from DriverTestCreateEmpty() and
DriverTestCreateBase() tests on ploop.

While I am not yet ready to submit ploop graph driver for review,
this change looks simple enough to push.

Note that filtering is done without any additional allocations,
as described in https://github.com/golang/go/wiki/SliceTricks.

[v2: added a comment about lost+found]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Upstream-commit: 158c536267a6530082cd60ba8f79a86444f0d2eb
Component: engine
2015-08-09 10:23:36 -07:00
f05efc7f51 Fix typo in Overlay documentation.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: f1f6738d974a5bb4f798a1f01fd074bfb45f681f
Component: engine
2015-08-08 15:11:09 -07:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
d20356ab98 daemon/graphdriver/overlay/ fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: de3944219f23ffe3ac83add4c1f2b0ec0a4cd5c0
Component: engine
2015-08-07 18:34:59 +00:00
9d9a4fd0c0 Merge pull request #15252 from coolljt0725/14765_enable_golint_3
Enable golint in pkg/archive
Upstream-commit: 8534090476b6eae66f1eca81e8bc0e0c61ed7197
Component: engine
2015-08-05 19:27:48 -04:00
a1cfc26eb3 Merge pull request #15269 from brahmaroutu/lint_daemon_graphdriver_zfs
daemon/graphdriver/zfs fix lint errrors/warnings
Upstream-commit: 2c3cd949c8db8f8bacccbd79c3f5650c8b32cabc
Component: engine
2015-08-04 18:41:02 -07:00
cc6eee4f4a daemon/graphdriver/zfs fix lint errrors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: e27c904b99e49e82f8d527e78161118d2b800523
Component: engine
2015-08-04 18:30:55 +00:00
3ba45e7906 Enable golint in pkg/arcive
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: ba332b7d12fba16e8c604728a44986886eeb07d6
Component: engine
2015-08-04 09:52:54 +08:00
4244c48345 daemon/graphdriver/vfs fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 3e7f9c636a4c74610a0da72937e54fb5a8000c25
Component: engine
2015-08-03 17:46:42 +00:00
385c38be8c Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage
Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c
Component: engine
2015-07-30 22:40:57 -04:00
bdce5e6b99 fix unit test breakage due to lint changes
Addresses #14756

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 22873eae3153f93b55b3b09eff887a3bfdc8eb54
Component: engine
2015-07-31 00:22:28 +00:00
3c8e934faf Simplify and fix os.MkdirAll() usage
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.

[v2: a separate aufs commit is merged into this one]

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

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Upstream-commit: a83a76934787a20e96389d33bd56a09369f9b808
Component: engine
2015-07-30 11:48:08 -07:00
197e6f60b8 Merge pull request #15040 from vbatts/vbatts-double-decompress-fix
archive, graphdriver: double decompress fix
Upstream-commit: 8724e8953d446ade61856d4944126ffccb2aead9
Component: engine
2015-07-29 16:48:02 -07:00
4cd45101c0 Merge pull request #13542 from kvasdopil/freebsd-work
Make docker build on FreeBSD
Upstream-commit: 75f8bdd970e5355a6238e7b41a9f1aee9cd3f890
Component: engine
2015-07-29 15:15:37 -07:00
abf825af14 Merge pull request #15111 from Microsoft/fix-archive-copy-log
Fix log to logrus
Upstream-commit: c09c497c71e3fbcec6fee6ee0f4eb5097fc1b4b7
Component: engine
2015-07-29 14:48:19 -04:00
59df5a01ec make docker compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 26c03d561ab126287bb3034cc23477d18869a888
Component: engine
2015-07-29 21:25:56 +03:00
a7dc60d0d3 Fix log to logrus
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2bf73c4b1a3b195ee426e74d221a9df032aaa89e
Component: engine
2015-07-29 09:58:07 -07:00
581a7026d5 daemon/graphdriver/devmapper/ fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 972a94b449ea6a68f041c47fe7bda35b5ac765a2
Component: engine
2015-07-29 01:43:34 +00:00
79954e9a3c graphdriver/*: expect uncompressed tar for ApplyDiff
The `ApplyDiff` function takes a tar archive stream that is
automagically decompressed later. This was causing a double
decompression, and when the layer was empty, that causes an early EOF.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 273f50c741e82a0be3e9f9d4c975cc18801dfe38
Component: engine
2015-07-28 16:36:39 -04:00
fb177a237a Merge pull request #14863 from brahmaroutu/lint_daemon_graphdriver_aufs
daemon/graphdriver/aufs fix lint errors/warnings
Upstream-commit: e06df594f5a449572d6807788f30a0240048b6a2
Component: engine
2015-07-28 11:46:40 -07:00
7f7157de05 daemon/graphdriver/aufs fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 55885daa56a0278ed5b412497b3bf99f52d6c52e
Component: engine
2015-07-28 06:17:05 +00:00
39dd67d7c5 daemon/graphdriver/graphtest/ fix lint errors/warnings
Addresses #14756

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 12460f41a462b441d40db1a70165f7854f3fb77a
Component: engine
2015-07-28 06:01:00 +00:00
b123b9f21b Fix typo in overlay's create godoc.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 5bac5302e59f0759545910ef748cc9a6f87db5c5
Component: engine
2015-07-27 15:37:26 -07:00
7e7519f5f0 Merge pull request #14875 from brahmaroutu/lint_daemon_graphdriver_btrfs
daemon/graphdriver/btrfs fix lint errors/warnings
Upstream-commit: 303345dc6a5179684bfe5f78ad9b3d73aba93d0e
Component: engine
2015-07-27 10:28:50 -07:00
Lei
26ba48c09d Add VxFS magic number, fixes #14847
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: e1c5e9b5610e46bf9526dafcbfba3332fe1983e0
Component: engine
2015-07-24 16:37:56 +08:00