Repository navigation
mount: Swallow error message if we ignore them - #421
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Diagnostic handling can lose messages on older kernels and concatenate printed records without line separators.
2 open issues
What changed in this PR
Suppresses diagnostics from expected mount-feature probe failures while preserving other filesystem-context messages.
Changes:
- Adds diagnostic buffering and selective discarding to
FsHandle. - Applies suppression to EROFS and overlayfs probes.
- Adds tests for diagnostic reading and preservation.
| File | Description |
|---|---|
crates/composefs/src/mount.rs |
Adds diagnostic handling, probe integration, and tests. |
crates/composefs-fuse/src/lib.rs |
Discards diagnostics from failed overlayfs capability probes. |
Review effort: Balanced
Comment on lines
+87
to
+89
| // An empty fscontext read returns ENODATA if no messages are pending, | ||
| // or EMSGSIZE without consuming the message. Allocate only on demand. | ||
| let mut buffer = Vec::new(); |
Collaborator
There was a problem hiding this comment.
Wow...I do wonder if copilot went and proactively dug into the APIs or if this somehow came from general knowledge?
Contributor
Author
There was a problem hiding this comment.
Yeah, that was pretty deep
Comment on lines
+124
to
+125
| // Kernel messages already have a newline. | ||
| eprint!("{}", String::from_utf8_lossy(error)); |
I was constantly getting an error on stderr like: ``` e Non-string source ``` Because we were trying the fsconfig_set_fd() which is not supported on my kernel. This adds some buffering mechanisms to FsHandle so we can discard any errors that stem from the erroring call, and then uses in this place and two others where we're doing similar things. This is slightly complicated by older kernels (before https://lkml.rescloud.iu.edu/2508.0/05302.html) swallowing the current entry when it returns EMSGSIZE. Signed-off-by: Alexander Larsson <alexl@redhat.com>
alexlarsson
force-pushed
the
swallow-ignored-mount-errors
branch
from
October 27, 2026 10:27
e11ab4c to
74dfed7
Compare
Contributor
Author
|
New version fixes both issues. It still avoids allocations on the likely path (no error) by using a stack buffer as the initial buffer, and it warns on possible data loss. |
Johan-Liebert1
approved these changes
Oct 27, 2026
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.

I was constantly getting an error on stderr like:
Because we were trying the fsconfig_set_fd() which is not supported on my kernel.
This adds some buffering mechanisms to FsHandle so we can discard any errors that stem from the erroring call, and then uses in this place and two others where we're doing similar things.