Commit graph

183 commits

Author SHA1 Message Date
Martijn Dwars
e2b8933d21 Move directory size calculation to pkg/ (fixes #10970)
Signed-off-by: Martijn Dwars <ikben@martijndwars.nl>
2015-03-04 21:16:31 +01:00
Srini Brahmaroutu
7a9c944b82 Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-23 18:43:10 +00:00
Vincent Batts
f4dc496d36 Merge pull request #10474 from petervo/10473-availble-space
Add available space to devicemapper status output
2015-02-10 16:32:51 +01:00
Peter Volpe
6816d27591 Detail available space behavior on loop devices
Signed-off-by: Peter Volpe <petervo@redhat.com>
2015-02-09 14:51:48 -08:00
Vincent Batts
67a4f1db10 Merge pull request #10440 from rhvgoyal/skip-dot-prefix-files
devicemapper: Skip the files with prefix "." during device map construct...
2015-02-09 10:26:27 +01:00
Tibor Vass
414a37f90a Merge pull request #10534 from unclejack/aufs_enable_dio
daemon/graphdriver/aufs: enable direct io
2015-02-06 18:26:09 -05:00
Sven Dowideit
fcb975cfd1 Fix a small spelling error in the dm.blkdiscard docs
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-02-05 10:57:33 +10:00
Jessica Frazelle
c809fc552b Fix for running unit tests on a 3.18 kernel with btrfs.
Was failing on overlay before and comparing the wrong error.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
2015-02-04 13:51:44 -08:00
unclejack
d18f5c3808 daemon/graphdriver/aufs: enable direct io
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-02-03 18:30:37 +02:00
Peter Volpe
726f89d77a Add available space to devicemapper status output
Signed-off-by: Peter Volpe <petervo@redhat.com>
2015-01-30 22:36:04 -08:00
Vivek Goyal
080a6f1e4b devicemapper: Skip the files with prefix "." during device map construction
Any file which starts with "." is not a valid metadata file. Skip it
during device map construction.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-01-29 13:19:18 -05:00
Jessica Frazelle
ec953b0e7b Blacklist zfs with overlay
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-23 14:00:15 -08:00
Michael Crosby
b8fe989b9b Merge pull request #10187 from jfrazelle/update-skip-graphtest
update graphtest
2015-01-21 14:09:16 -08:00
Vincent Batts
9b2afa04f8 Merge pull request #10222 from vbatts/vbatts-dm_flag_and_output
dm flag and output
2015-01-20 18:45:43 -05:00
Vincent Batts
0c8be9da37 devmapper: initialize log levels
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-01-20 13:31:19 -05:00
Vincent Batts
a09a665d99 devmapper: some explination of docker info
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2015-01-19 17:37:08 -05:00
Vincent Batts
4cfe9df0a9 devicemapper: debug output specifics
moar information for the information gods

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-01-19 17:21:10 -05:00
Vincent Batts
d2593546f9 devmapper: udev sync in docker info
now:

```
[...]
Storage Driver: devicemapper
 Pool Name: docker-253:2-5767172-pool
 [...]
 Udev Sync Supported: true
[...]
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-01-19 16:28:02 -05:00
Vincent Batts
022e1232f8 devmapper: udev sync on init
when initializing the devmapper driver, attempt to sync udev and device
mapper. If udev sync is not supported, print a warning. Eventually we'll
likely bail here to avoid unpredictable behavior for users.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-01-19 15:57:25 -05:00
Jessica Frazelle
f0d79c021d Update graphtest so when overlay is tried over a non-supported backing
filesystem it will skip.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-19 10:28:57 -08:00
Phil Estes
48b1dd0084 Add backing filesystem info to docker info command where applicable
Fixes #9960

This adds the output of a "Backing Filesystem:" entry to `docker info`
to overlay, aufs, and devicemapper graphdrivers. The default list
includes a fairly complete list of common filesystem names from
linux/include/uapi/linux/magic.h, but if the backing filesystem is not
recognized, the code will simply show "<unknown>"

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2015-01-16 14:43:43 -05:00
Jessica Frazelle
f88066fd43 ignore vfs from warning
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-14 17:28:50 -08:00
Alexander Morozov
bb96e53b0f Fix vet error about passing Mutex by value
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-01-14 14:03:00 -08:00
unclejack
044d979f4e Merge pull request #10003 from vbatts/vbatts-dm_loop_file_info
devmapper: show device and loop file , if used
2015-01-14 01:15:09 +02:00
Michael Crosby
16fe2ac6b2 Merge pull request #9988 from nponeccop/patch-1
FsMagic should avoid sign extension on i686
2015-01-12 12:02:09 -08:00
Alexander Morozov
83ab6237ac Merge pull request #10047 from vbatts/vbatts-graphdriver_driver_put_with_error
graphdriver: change (*Driver).Put signature
2015-01-12 11:42:11 -08:00
Vincent Batts
2b51d1a167 devmapper: remove newline string
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-01-12 13:40:42 -05:00
Vincent Batts
00fd63e558 graphdriver: change (*Driver).Put signature
There are a couple of drivers that swallow errors that may occur in
their Put() implementation.

This changes the signature of (*Driver).Put for all the drivers implemented.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2015-01-12 13:34:35 -05:00
Vincent Batts
09c033ff87 devmapper: show device and loop file , if used
Presenly the "Data file:" shows either the loopback _file_ or the block device.
With this, the "Data file:" will always show the device, and if it is a
loopback, then there will additionally be a "Data loop file:".
(Same for "Metadata file:")

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-01-09 11:20:07 -05:00
nponeccop
c754555b87 FsMagic should avoid sign extension on i686
`uint64(buf.Type)` on i686 is ffffffff9123683e on i686 due to sign extension, so it cannot be compared with `FsMagic(0x9123683E)`

Signed-off-by: Andrii Melnykov <andy.melnikov@gmail.com>
2015-01-09 02:44:04 +02:00
Michael Crosby
6d780139c4 Merge pull request #8748 from duglin/Issue8330
Have .dockerignore support Dockerfile/.dockerignore
2015-01-06 13:47:42 -08:00
Michael Crosby
9d1caf4272 Merge pull request #9834 from jfrazelle/9820-overlay-btrfs
Add error when running overlay over btrfs.
2015-01-06 13:16:17 -08:00
Jessica Frazelle
32f1025b22 Add error when running overlay over btrfs.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-06 11:22:45 -08:00
Doug Davis
6d801a3caa Have .dockerignore support Dockerfile/.dockerignore
If .dockerignore mentions either then the client will send them to the
daemon but the daemon will erase them after the Dockerfile has been parsed
to simulate them never being sent in the first place.

an events test kept failing for me so I tried to fix that too

Closes #8330

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-06 10:57:48 -08:00
Jessie Frazelle
e404113afc Merge pull request #9908 from crosbymichael/warning-graphdriver
Add warning log when high priority graphdriver used before
2015-01-05 12:06:28 -08:00
Michael Crosby
3011aa4e99 Remove error return from check graph driver func
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-05 10:34:49 -08:00
Derek
9bbed5ab4c change to lazy Unmount
syscall.Unmount failed sometimes when user interrupted exporting,
for example a Ctrl-C, or pipe to commands which closed the pipe early,
like "docker export <container_name> | file -"; this syscall.Unmount
could sometimes return EBUSY and didn't actually umount the filesystem;
which would cause a following export command fail to mount;
change to lazy Unmount with MNT_DETACH can fix the problem, this is
the same behavior as in Shutdown;

```text
time="2015-01-03T21:27:26Z" level=error msg="Warning: error unmounting device
34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e: device or resource busy"
```

```
$ docker export thirsty_ardinghelli | file -
/dev/stdin: POSIX tar archive
time="2015-01-03T21:58:17Z" level=fatal msg="write /dev/stdout: broken pipe"
$ docker export thirsty_ardinghelli
time="2015-01-03T21:54:33Z" level=fatal msg="Error: thirsty_ardinghelli: Error getting container
34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e from driver devicemapper:
Error mounting '/dev/mapper/docker-253:0-3148372-34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e'
on '/var/lib/docker/devicemapper/mnt/34a3e77cdbca17ceffd0636aee0415bb412996adb12360bfe2585ce30467fa8e': device or resource busy"
```

Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-04 00:10:48 +00:00
daehyeok mun
3c03827e73 Add warnning log when other graphdrvier(storage driver) used before
added warnning log when other graphdrvier(storage driver) used before for feature request #8270

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2015-01-02 00:01:26 +09:00
Pierre Wacrenier
c1e04fbb15 Remove unused function from vfs storage driver
Signed-off-by: Pierre Wacrenier <pierre.wacrenier@gmail.com>
2014-12-23 00:36:20 +01:00
Michael Crosby
2acb856dff Merge pull request #9233 from inatatsu/fix-pkg-units-size-for-gccgo
Fix to avoid a compile error due to float to int truncation with GCCGO
2014-12-18 18:33:01 -08:00
Josh Hawn
35a22c9e12 Refactor to optimize storage driver ApplyDiff()
To avoid an expensive call to archive.ChangesDirs() which walks two directory
trees and compares every entry, archive.ApplyLayer() has been extended to
also return the size of the layer changes.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-12-17 21:54:23 -08:00
Alexander Morozov
c7ff6bf691 Fix vet errors about json tags for unexported fields
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 11:01:46 -08:00
Alexander Morozov
2540765ddc Fix vet errors in aufs.go about Lock by value
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 10:46:09 -08:00
Vincent Batts
74bbb93571 Merge pull request #9258 from rhvgoyal/transaction-id-improvements
devmapper fix usage of pool transaction id
2014-12-11 12:58:18 -05:00
Michael Crosby
f47d6b9b9d Use consistent ApplyLayer in overlayfs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-04 12:03:44 -08:00
Vivek Goyal
17b75a21a6 devmapper: Use transactions during device deletion
Use transaction logic during device deletion and do rollback if transaction
is not complete. Following is the sequence of events.

- Open transaction and save to metafile
- Delete device from pool
- Delete device metadata file from disk
- Close Transaction

If docker crashes without closing transaction then rollback will take
place upon next docker start.
 
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2014-12-03 13:06:43 -05:00
Vivek Goyal
c115c4aa45 devmapper: Use transaction mechanism during device or snap device creation
Finally this patch uses the notion of transaction for device or snapshot
device creation. 

Following is sequence of event.

- Open a trasaction and save details in a file.
- Create a new device/snapshot device
- If a new device id is used, refresh transaction with new device id details.
- Create device metadata file
- Close transaction.

If docker crashes anywhere in between without closing transaction, then
upon next start, docker will figure out that there was a pending transaction
and it will roll back transaction. That is it will do following.

- Delete Device from pool
- Delete device metadata file
- Remove transaction file to mark no transaction is pending.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2014-12-03 13:06:43 -05:00
Vivek Goyal
e28a419e11 devmapper: Find a free device Id to use for device creation
Finally, we seem to have all the bits to keep track of all used device
Ids and find a free device Id to use when creating a  new device. Start
using it.

Ideally we should completely move away from retry logic when pool returns
-EEXISTS. For now I have retained that logic and I simply output a warning.
When things are stable, we should be able to get rid of it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2014-12-03 13:06:43 -05:00
Vivek Goyal
14d0dd855e devmapper: Open code createDevice() and createSnapDevice()
Open code createDevice() and createSnapDevice() and move all the logic
in the caller.

This is a sheer code reorganization so that all device Id allocation
logic is in one function. That way in case of erros, one can easily
cleanup and mark device Id free again. (Later patches benefit from
it).

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2014-12-03 13:06:43 -05:00
Vivek Goyal
a44c23fe66 devmapper: Provide a helper function getNextDeviceId()
Right now we are accessing devices.NextDeviceId directly and also 
incrementing it at various places.

Instead provide a helper function which is responsile for
incrementing NextDeviceId and return next deviceId. 

This is just code structuring. This will help later once we
convert this function to find a free device Id and it goes
through a bitmap of used/free device Ids.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2014-12-03 13:06:43 -05:00