Fix: prevent snapshotter from deleting in-use devices during snapshot removal#350
Merged
Merged
Conversation
a4154bf to
2c3e701
Compare
2c3e701 to
c52d9a7
Compare
… removal Signed-off-by: 洛可 <dingzhaowen.dzw@alibaba-inc.com>
c52d9a7 to
89c0790
Compare
Member
|
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 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.
What this PR does / why we need it:
When using a Kata runtime, the OverlayFS mount is performed in a different namespace, making it invisible from the host environment. However, when performing unmount and device detachment, the snapshotter checks if the host has any mounts using this device and will continue device detachment if it detects no host-level mounts.
In this case, during UnmountAndDetachBlockDevice, checkOverlaybdInUse will return "not in use," even though this snapshot is actually being used by another active snapshot.
Therefore, when we perform unmount and device detach, we should check the DB to see whether an active snapshot is using this device. If true, we shouldn't unmount or detach the block device, because this will cause active containers to lose access to their filesystems.
Please check the following list: