mount.RecursiveUnmount: add a fast path#26
Merged
AkihiroSuda merged 2 commits intomoby:masterfrom Aug 31, 2020
Merged
Conversation
In many cases, this is called with an argument that is a mount point itself. In such case, if we're on Linux, MNT_DETACH ensures that the umount is recursive (which is its nice, but a little known feature). For other platforms, if the mount does not have any submounts underneath and is not busy, it will be unmounted. In the above case, we no longer have to parse mountinfo and perform the unmounts one-by-one. IOW this should speed up RecursiveUnmount() for some cases, without breaking the compatibility. While at it - fix a typo in doc; - add that the argument does not have to be a mount point. Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
Collaborator
Author
|
@cpuguy83 PTAL |
Member
|
Will this introduce a risk of having orphan mounts on error? |
Collaborator
Author
If your concern is about MNT_DETACH, we use this flag anyway, so AFAIU we're not making anything worse. Please see a longer discussion in #21. If it is something different, please explain your concern in more details. |
AkihiroSuda
approved these changes
Aug 31, 2020
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In many cases, this is called with an argument that is a mount point
itself. In such case, if we're on Linux, MNT_DETACH ensures that the
umount is recursive (which is its nice, but a little known feature).
For other platforms, if the mount does not have any submounts
underneath and is not busy, it will be unmounted.
In the above case, we no longer have to parse mountinfo and perform
the unmounts one-by-one.
IOW this should speed up RecursiveUnmount() for some cases, without
breaking the compatibility.
While at it
Fixes: #21