This repository was archived by the owner on Oct 13, 2023. It is now read-only.
[18.09 backport] overlay2: use index=off if possible (fix EBUSY on mount)#84
Merged
seemethere merged 2 commits intodocker-archive:18.09from Nov 21, 2018
Merged
Conversation
This simplifies the code a lot. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit a55d325) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
As pointed out in moby#37970, Docker overlay driver can't work with index=on feature of the Linux kernel "overlay" filesystem. In case the global default is set to "yes", Docker will fail with EBUSY when trying to mount, like this: > error creating overlay mount to ...../merged: device or resource busy and the kernel log should contain something like: > overlayfs: upperdir is in-use by another mount, mount with > '-o index=off' to override exclusive upperdir protection. A workaround is to set index=off in overlay kernel module parameters, or even recompile the kernel with CONFIG_OVERLAY_FS_INDEX=n in .config. Surely this is not always practical or even possible. The solution, as pointed out my Amir Goldstein (as well as the above kernel message:) is to use 'index=off' option when mounting. NOTE since older (< 4.13rc1) kernels do not support "index=" overlayfs parameter, try to figure out whether the option is supported. In case it's not possible to figure out, assume it is not. NOTE the default can be changed anytime (by writing to /sys/module/overlay/parameters/index) so we need to always use index=off. [v2: move the detection code to Init()] [v3: don't set index=off if stat() failed] Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit 8422d85) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
ping @kolyshkin @dmcgowan PTAL |
|
LGTM |
seemethere
approved these changes
Nov 21, 2018
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport of moby#37993 for 18.09
fixes moby#37970
cherry-pick was clean, no conflicts