Skip to content

fix(mountinfo): join super options split on spaces - #873

Open
arimu1 wants to merge 2 commits into
prometheus:masterfrom
arimu1:fix/mountinfo-super-options-space-872
Open

arimu1 wants to merge 2 commits into
prometheus:masterfrom
arimu1:fix/mountinfo-super-options-space-872

Conversation

@arimu1

@arimu1 arimu1 commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

  • Find the mountinfo - separator by scanning fields after mount options instead of assuming a fixed index from the end of the line.
  • Join all fields after the mount source into super options so values with unescaped spaces (Docker Desktop 9p path= on WSL2) parse correctly.
  • Parse mount option key/value pairs with strings.SplitN(..., "=", 2) so embedded = in values is preserved.

Fixes #872

Test plan

Locate the mountinfo separator field instead of assuming a fixed
offset, and join any trailing fields into super options so unescaped
spaces in values (e.g. Docker Desktop 9p path= on WSL2) do not break
parsing. Use SplitN when parsing key=value mount options.

Fixes prometheus#872

Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
CI lint failed because the composite literal alignment was not gofmt-clean.

Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
@arimu1
arimu1 force-pushed the fix/mountinfo-super-options-space-872 branch from c0db6ff to 69effe4 Compare September 27, 2026 05:48
@SuperQ

SuperQ commented Sep 27, 2026

Copy link
Copy Markdown
Member

I'm thinking #874 is a more robust solution. What do you think?

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.

mountinfo: parse fails when super options contain an unescaped space (WSL2 + Docker Desktop 9p mount)

2 participants