-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix umount cleanup #27
Open
mikemccracken
wants to merge
2
commits into
project-machine:main
Choose a base branch
from
mikemccracken:2024.12.16/main/fix-umount-cleanup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix umount cleanup #27
mikemccracken
wants to merge
2
commits into
project-machine:main
from
mikemccracken:2024.12.16/main/fix-umount-cleanup
Conversation
This file contains 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
mikemccracken
force-pushed
the
2024.12.16/main/fix-umount-cleanup
branch
3 times, most recently
from
December 18, 2024 21:57
f4da069
to
0e101bd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
===========================================
+ Coverage 15.68% 44.50% +28.81%
===========================================
Files 7 14 +7
Lines 1358 1692 +334
===========================================
+ Hits 213 753 +540
+ Misses 1117 789 -328
- Partials 28 150 +122 ☔ View full report in Codecov by Sentry. |
mikemccracken
force-pushed
the
2024.12.16/main/fix-umount-cleanup
branch
from
December 18, 2024 23:53
1cc33db
to
be2c195
Compare
Since eaa7b43, Umount was not cleaning up backing devices correctly, but this was not caught in tests. Stacker's test suite had a test that noticed. It isn't clear that Umount as used in the `atomfs` cli tool was correct before eaa7b43 either, because the underlying atom mount points were put under the overmounted final mount point, and would thus not be shared by other molecule mounts. This also wasn't being tested though. This commit fixes Umount, and: - consolidates all unmounting logic - out of `cmd/umount` and into the package in `atomfs.Umount`. - adds a version of the test from Stacker that noticed this - that test belongs here instead of in stacker. Also fixed a couple seeming typos in that test that hid failures. - fixes the lock path used in Umount to match that used in Mount, which was out of sync since eaa7b43 - splits out the verity.go squashfs.Umount code to allow for getting backing devices of an atom without unmounting it, in order to only clean up the backing dev if it is no longer in use Signed-off-by: Michael McCracken <[email protected]>
- updates codecov action version - make batstest now builds with coverage and runs all bats tests with coverage, then merges into a file codecov knows about Signed-off-by: Michael McCracken <[email protected]>
mikemccracken
force-pushed
the
2024.12.16/main/fix-umount-cleanup
branch
2 times, most recently
from
December 19, 2024 00:22
1b416ab
to
7673e52
Compare
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.
Fix cleanup of underlying molecules, which was broken by recent changes that moved the mount points for the atoms under a directory named after the final mount point - so the refcounting broke.
the fix is to always unmount the atom mount points and then just check if the backing device is still used, and clean it up if not. No "refcounting" in code here, just using the mount table to check if it's in use.
I think this will not work great if there is a mix of mounts in different mount namespaces that use the same atoms.
I am not sure what a good solution for that case would look like.
This was not caught by tests until we ran stacker tests on it, where a test that should have been moved to this repo when we originally split it out caught the cleanup issue. I've moved that test here.