-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
contrib/fs-idmap: Minor cleanups #3954
Conversation
97c0711
to
8cfa68b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is what we should do, although in practice this probably won't be a big issue as the parent also exits. While we are there, instead of waiting for the child to finish, kill it if we did everything we wanted to do. Signed-off-by: Rodrigo Campos <[email protected]>
f5dfe17
to
27b4886
Compare
@cyphar @kolyshkin All fixed now, PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I don't think this change needs 8 commits.
We don't really need to check if AT_RECURSIVE is possible here. We just want to check if we can idmap the src, it doesn't matter other nested mounts. While we are there, allow relative paths too. Signed-off-by: Rodrigo Campos <[email protected]>
If more args are passed, let's just throw an error. Signed-off-by: Rodrigo Campos <[email protected]>
Let's just rely on the lookup performed to find the sleep binary. This didn't cause any issues as far as I know, I just saw this while doing other cleanups. Signed-off-by: Rodrigo Campos <[email protected]>
We can't call log.Fatalf() and defer functions, as the former doesn't call any defers. Let's just move the code to a new function and call os.Exit() only in main, when all defer executed. Now that all the code is one function, we only print twice to stderr. It is simpler to just print to stderr instead of logging and having also the timestamp we don't really want. Signed-off-by: Rodrigo Campos <[email protected]>
@cyphar heh, agreed. Squashed some commits now. Other than that, no changes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In fact, this is more than "minor cleanups" -- this allows the tests to be skipped when they are needed to be skipped. |
Thank you for the merge! |
@kolyshkin really, how so? Do you happen to know? It was skipping tests before this PR just fine on CI. But I'm glad this helps :) |
Here are some cleanups to the fs-idmap binary that we use in integration test to detect if a fs supports idmap mounts or not.
These are just minor cleanups, I'm not fixing any real bug we hit nor anything (I'm not aware of any).
cc @eiffel-fl