Commit Graph

19 Commits

Author SHA1 Message Date
f8c71718b6 DeviceMapper: Succeed immediately when removing non-existant devices
We've seen situations where removal of "ID-init" failed during
container deletion (EBUSY), after removal of "ID" has succeeded. This
caused the container delete operation to fail, and on the next delete
attempt the removal of "ID" failed immediately with "does not exist".

Ideally we should not fail the ID-init removal, but its also non-ideal
to allow a state where the container is half-removed and we cannot
make progress deleting the container. So, we silently ignore not-exist
errors on device removal.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 1cdd775f5d95c4da2895da85b00ffa2917bbf9b0
Component: engine
2014-03-06 15:12:09 +01:00
abb4de8546 devmapper: Remove directory when removing devicemapper device
We're currently leaving around lots of empty directories in
/var/lib/docker/devicemapper/mnt/ for removed images and containers.
Fix this by removing the directory when the device is removed.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 2343fe44533f19ebae5e6127f4a2a19d1d8773fa
Component: engine
2014-02-11 09:40:13 +01:00
d2595404a2 devmapper: Move refcounting to DeviceSet
We already have some kind of refcounting in DeviceSet, this fleshes
it out to allow it to completely subsume the refcounting in
devmapper.Driver.

This allows us to drop the double refcounting, and the locking inside
devmapper.Driver. This, in particular the locking simplification will
make it easier in the future to parallelize the device mapper.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: b95c560fdda4813319a2377e240592a3261e30ef
Component: engine
2014-02-06 13:14:42 +01:00
3ce6127194 devmapper: Rename DeviceSet.RemoveDevice to DeleteDevice
"Remove" is a bit overloaded, as it is also what deactivating a
device mapper device is called. Using "delete" is more clear here.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 63d4b293e7c91b8e2ed8da56f338f1bd0a4e1464
Component: engine
2014-02-05 21:27:12 +01:00
e8f6d5eb59 Update/fix build tags, Dockerfile, and release.sh for proper building and releasing of linux/386 and linux/arm cross-compiled client binaries
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 065dd231dd7d7858df982a8decfade9df936cf63
Component: engine
2014-01-31 03:16:42 -07:00
4d1276ba85 devicemapper: Unmount inactive devices
This implements the new Put() operation such that
Get()/Put() maintains a refcount for each ID, mounting
only on first Get() and unmounting on the last Get().

This means we avoid littering the system with lots of mounts
and active devicemapper devices and free resources related
to them.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

asdfljk
Upstream-commit: 886f650d9b2133fb61e7cc5b0bb7795246852026
Component: engine
2014-01-21 11:26:11 +01:00
5e35604785 Add Put() to graphdriver API and use it
This makes all users of Put() have a corresponding call
to Get() which means we will be able to track whether
any particular ID is in use and if not unmount it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: bcaf6c2359d83acd5da54f499e21f4a148f491c5
Component: engine
2014-01-21 11:25:37 +01:00
5f4f9d994f Make devicemapper linux-only
Upstream-commit: 24c03b2d938d383dd7669dc8faad7e2110a11173
Component: engine
2013-11-27 19:12:51 -08:00
26fbc2e027 Forbid syscalls in tests, add 2 new unit tests
Upstream-commit: bc82940a575944e4686db203356a8a3fb3a75217
Component: engine
2013-11-21 16:32:16 -08:00
3bd981cb53 Remove os from devmapper
Upstream-commit: a39bd656622c7dbea534fe34710ed6cb21dd5a90
Component: engine
2013-11-20 13:05:17 -08:00
f6524ff456 Handle image metadata when drivers are switched
Upstream-commit: 1b28cdc7f977f265d0d8de53e8ec1d773ed54db1
Component: engine
2013-11-20 10:31:51 -08:00
cdf4bbcde9 Merge pull request #41 from alexlarsson/dm-plugin-device-tool
Update docker-device-tool
Upstream-commit: 3e0a5ac48bfc65950b31bc7311d2662816cbe475
Component: engine
2013-11-19 15:38:47 -08:00
58c3812d34 Merge pull request #43 from alexlarsson/dm-plugin-use-root-subdir
devmapper: Use a "root" subdirectory in the devmapper volume
Upstream-commit: 5a4113140e4a9f00a2f3d97205fe7e146f955b4b
Component: engine
2013-11-19 13:51:04 -08:00
a68204dea9 Merge pull request #45 from alexlarsson/dm-plugin-diff-size
Implement fallback for getting the size of a container
Upstream-commit: 4c2624a277195c9a0d6fabca29cf3a769e1e6482
Component: engine
2013-11-19 10:25:31 -08:00
f13b8265b6 devicemapper: Unmount when removing device
Without this the remove will fail due to a busy device.
Upstream-commit: 0ed762f2d2ff613052b81d06509dac06b13fc0c9
Component: engine
2013-11-19 14:40:15 +01:00
99bee9426b Implement fallback for getting the size of a container
This moves Driver.Size() to Differ.DiffSize(), removing the empty
implementations in devmapper and dummy, and renaming the one in aufs.

Then we fall back to a container.Changes() implementation in the non-aufs
case.
Upstream-commit: 5d76681c3d0cbb744205a397420603ce029ce754
Component: engine
2013-11-19 10:36:54 +01:00
08c42330ce devmapper: Update device-mapper-tool
This makes the device mapper tool work again and adds new features
to get pool status, device status and to list all devices.
Upstream-commit: 80aecc70141f3e7b3138752bf3f0c33b9a273714
Component: engine
2013-11-19 09:44:19 +01:00
8ad4e865dc devmapper: Use a "rootfs" subdirectory in the devmapper volume
We place the actual image/containers in the "rootfs" directory, which
allows us to have other data in the toplevel directory in the mount.

For starters, this means the "lost+found" directory from mkfs will
not always be in your container/image.

Secondly, we can create a file "id" in the toplevel dir which is not
visible from the container. This is useful because it allows us to map
back from the device fs to the container if something goes wrong with
the devicemapper metadata.
Upstream-commit: 00401a30b73d897255b7b99996d7c6a53fe2d4af
Component: engine
2013-11-19 09:29:42 +01:00
052ebaaf52 Move all drivers to the same subdir graphdriver
Upstream-commit: 035c1442424ee502118cdbf2ee2dddafcc0f01cd
Component: engine
2013-11-15 15:48:24 -08:00