Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refcounts to graphdrivers that use fsdiff #22168

Merged
merged 1 commit into from
Apr 22, 2016

Conversation

cpuguy83
Copy link
Member

@cpuguy83 cpuguy83 commented Apr 19, 2016

This makes sure fsdiff doesn't try to unmount things that shouldn't be.

Note: This is intended as a temporary solution to have as minor a
change as possible for 1.11.1. A bigger change will be required in order
to support container re-attach.

Fixes #22116

@cpuguy83 cpuguy83 force-pushed the 22116_hack_in_layer_refcounts branch from 0a63c60 to 9f277e8 Compare April 19, 2016 19:51
@cpuguy83 cpuguy83 added this to the 1.11.1 milestone Apr 19, 2016
@cpuguy83 cpuguy83 force-pushed the 22116_hack_in_layer_refcounts branch 3 times, most recently from e16f0ef to f8085d1 Compare April 19, 2016 20:25
@icecrime
Copy link
Contributor

13:35:44 ---> Making bundle: binary (in bundles/1.12.0-dev/binary)
13:35:44 Building: bundles/1.12.0-dev/binary/docker-1.12.0-dev
13:36:26 # github.com/docker/docker/daemon/graphdriver/overlay
13:36:26 daemon/graphdriver/overlay/overlay.go:399: undefined: mountpoint
13:36:26 daemon/graphdriver/overlay/overlay.go:404: undefined: mountpoint

@icecrime icecrime added the status/failing-ci Indicates that the PR in its current state fails the test suite label Apr 19, 2016
@cpuguy83 cpuguy83 force-pushed the 22116_hack_in_layer_refcounts branch from f8085d1 to 8b3cd7a Compare April 19, 2016 21:27
@cpuguy83 cpuguy83 removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Apr 19, 2016
@cpuguy83
Copy link
Member Author

all 💚

@@ -338,7 +339,7 @@ func (d *Driver) Remove(id string) error {
}

// Get creates and mounts the required file system for the given id and returns the mount path.
func (d *Driver) Get(id string, mountLabel string) (string, error) {
func (d *Driver) Get(id string, mountLabel string) (_ string, retErr error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen this done before. (_ string). I don't know if this is cool or something horrid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, cleaned this up :)

@cpuguy83 cpuguy83 force-pushed the 22116_hack_in_layer_refcounts branch from 8b3cd7a to a6a01b1 Compare April 21, 2016 16:17
This makes sure fsdiff doesn't try to unmount things that shouldn't be.

**Note**: This is intended as a temporary solution to have as minor a
change as possible for 1.11.1. A bigger change will be required in order
to support container re-attach.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83 cpuguy83 force-pushed the 22116_hack_in_layer_refcounts branch from a6a01b1 to 7342060 Compare April 21, 2016 16:20
@crosbymichael
Copy link
Contributor

LGTM

@tonistiigi
Copy link
Member

@cpuguy83 Is it ok that the Get/Put methods are not protected with locks for these drivers?

@cpuguy83
Copy link
Member Author

@tonistiigi It's overall racey I think in terms of the reference counting, but not likely to be a problem in this scenario.

@tonistiigi
Copy link
Member

LGTM

@calavera
Copy link
Contributor

LGTM

@rhatdan
Copy link
Contributor

rhatdan commented May 24, 2016

Any chance this is causing the following issue.

In one window

docker run -ti fedora /bin/sh
touch /dan /walsh

In another window

docker diff tender_yalow
A /dan
C /run
A /run/secrets
A /walsh

Run it a second time.

# docker diff tender_yalow
Error response from daemon: devmapper: Error mounting '/dev/mapper/docker-8:2-3014778-3de7ffab70c81acb1d0b91e9910fe9749893bf692c5f4b766f9c158c5261cee4'
on '/var/lib/docker/devicemapper/mnt/3de7ffab70c81acb1d0b91e9910fe9749893bf692c5f4b766f9c158c5261cee4':
invalid argument
# docker version
Client:
 Version:         1.11.1
 API version:     1.23
 Package version: docker-1.11.1-2.gitaaa9488.fc25.x86_64
 Go version:      go1.6.2
 Git commit:      aaa9488/1.11.1
 Built:
 OS/Arch:         linux/amd64

Server:
 Version:         1.11.1
 API version:     1.23
 Package version: docker-1.11.1-2.gitaaa9488.fc25.x86_64
 Go version:      go1.6.2
 Git commit:      aaa9488/1.11.1
 Built:
 OS/Arch:         linux/amd64

@cpuguy83
Copy link
Member Author

@rhatdan Yes, most likely.
We're considering a 1.11.2 release and including this in.

Note this whole patch is reworked for 1.12 to support the daemon restore case, so please take a look at master as well!

@cpuguy83 cpuguy83 deleted the 22116_hack_in_layer_refcounts branch May 24, 2016 14:21
@rhatdan
Copy link
Contributor

rhatdan commented May 24, 2016

Yes I will try it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants