Skip to content

mount: Swallow error message if we ignore them - #421

Merged
Johan-Liebert1 merged 1 commit into
mainfrom
swallow-ignored-mount-errors
Oct 27, 2026
Merged

Johan-Liebert1 merged 1 commit into
mainfrom
swallow-ignored-mount-errors

Conversation

@alexlarsson

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread crates/composefs/src/mount.rs Outdated
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();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow...I do wonder if copilot went and proactively dug into the APIs or if this somehow came from general knowledge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was pretty deep

Comment thread crates/composefs/src/mount.rs Outdated
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
alexlarsson force-pushed the swallow-ignored-mount-errors branch from e11ab4c to 74dfed7 Compare October 27, 2026 10:27
@alexlarsson

Copy link
Copy Markdown
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
Johan-Liebert1 added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit d015204 Oct 27, 2026
18 checks passed
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.

4 participants