Skip to content

Fix overlay2 busy error on mount#39780

Merged
yongtang merged 1 commit intomoby:masterfrom
dmcgowan:fix-overlay-mount-busy
Aug 24, 2019
Merged

Fix overlay2 busy error on mount#39780
yongtang merged 1 commit intomoby:masterfrom
dmcgowan:fix-overlay-mount-busy

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

@dmcgowan dmcgowan commented Aug 21, 2019

When mounting overlays which have children, enforce that
the mount is always performed as read only. Newer versions
of the kernel return a device busy error when a lower directory
is in use as an upper directory in another overlay mount.

Adds committed file to indicate when an overlay is being used
as a parent, ensuring it will no longer be mounted with an
upper directory.

Related to kernel@146d62e5a586

Description for the changelog

Overlay2: fix busy error on mount when using newer (>= 5.2) kernels

When mounting overlays which have children, enforce that
the mount is always performed as read only. Newer versions
of the kernel return a device busy error when a lower directory
is in use as an upper directory in another overlay mount.

Adds committed file to indicate when an overlay is being used
as a parent, ensuring it will no longer be mounted with an
upper directory.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
opts = indexOff + "lowerdir=" + diffDir + ":" + strings.Join(absLowers, ":")
} else {
opts = indexOff + "lowerdir=" + strings.Join(absLowers, ":") + ",upperdir=" + diffDir + ",workdir=" + workDir
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I generally prefer something like this to remove the repetition.

	opts := indexOff + "lowerdir=" + diffDir + ":" + strings.Join(absLowers, ":")
	if !readonly {
		opts += ",upperdir=" + diffDir + ",workdir=" + workDir
	}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

diffDir is only in lower for the readonly case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah right, i missed diffDir.

Copy link
Copy Markdown
Member

@yongtang yongtang left a comment

Choose a reason for hiding this comment

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

LGTM

@yongtang yongtang merged commit 2a64e34 into moby:master Aug 24, 2019
@thaJeztah thaJeztah deleted the fix-overlay-mount-busy branch August 26, 2019 18:29
ianvernon pushed a commit to cilium/packer-ci-build that referenced this pull request Oct 18, 2019
This has been fixed upstream by Docker ( moby/moby#39780 ).

Signed-off by: Ian Vernon <ian@cilium.io>
ianvernon pushed a commit to cilium/packer-ci-build that referenced this pull request Oct 21, 2019
This has been fixed upstream by Docker ( moby/moby#39780 ).

Signed-off by: Ian Vernon <ian@cilium.io>
ianvernon pushed a commit to cilium/packer-ci-build that referenced this pull request Oct 21, 2019
This has been fixed upstream by Docker ( moby/moby#39780 ).

Signed-off by: Ian Vernon <ian@cilium.io>
@thaJeztah thaJeztah added this to the 20.03.0 milestone Apr 2, 2020
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.

7 participants