Skip to content
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

[DNM carry/fix #3967] Remove mount fallback flag #3975

Closed

Conversation

kolyshkin
Copy link
Contributor

This is #3967 with the added commit to fix the issue with the bats test.

For testing purposes.

kolyshkin and others added 2 commits August 8, 2023 17:47
Function teardown assumes that every test case will call
setup_sshfs. Currently, this assumption is true, but once
a test case that won't call setup_sshfs is added (say because
it has some extra "requires" or "skip"), it will break bats,
so any bats invocation involving such a test case will end up
hanging after the last test case is run.

The reason is, we have set -u in helpers.bash to help catching the use
of undefined variables. In the above scenario, such a variable is DIR,
which is referenced in teardown but is only defined after a call to
setup_sshfs. As a result, bash that is running the teardown function
will exit upon seeing the first $DIR, and thus teardown_bundle won't be
run. This, in turn, results in a stale recvtty process, which inherits
bats' fd 3. Until that fd is closed, bats waits for test logs.

Long story short, the fix is to
 - check if DIR is set before referencing it;
 - unset it after unmount.

PS it is still not clear why there is no diagnostics about the failed
teardown.

Signed-off-by: Kir Kolyshkin <[email protected]>
The original reasoning for this option was to avoid having mount options
be overwritten by runc. However, adding command-line arguments has
historically been a bad idea because it forces strict-runc-compatible
OCI runtimes to copy out-of-spec features directly from runc and these
flags are usually quite difficult to enable by users when using runc
through several layers of engines and orchestrators.

A far more preferable solution is to have a heuristic which detects
whether copying the original mount's mount options would override an
explicit mount option specified by the user. In this case, we should
return an error.

Fixes: da780e4 ("Fix bind mounts of filesystems with certain options set")
Signed-off-by: Aleksa Sarai <[email protected]>
@kolyshkin kolyshkin marked this pull request as draft August 9, 2023 00:53
@kolyshkin kolyshkin changed the title [carry #3967] Remove mount fallback flag [DNM carry/fix #3967] Remove mount fallback flag Aug 9, 2023
@kolyshkin kolyshkin closed this Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants