Skip to content

Fix WSL2 mountinfo parsing - #874

Merged
SuperQ merged 1 commit into
masterfrom
superq/fix_mountinfo_parse
Oct 19, 2026
Merged

SuperQ merged 1 commit into
masterfrom
superq/fix_mountinfo_parse

Conversation

@SuperQ

@SuperQ SuperQ commented Sep 27, 2026

Copy link
Copy Markdown
Member

The WSL2 mountinfo doesn't correctly escape paths in the super options list. Refactor the parser to split the line in stages before and after the - separator. This makes the parsing logic simpler since we don't need to track the separator index anymore.

  • Fix a small bug in the option parser that doesn't deal with multiple = chars in the comma-separated option strings.
  • Fix OptionalFields to always return an empty map rather than nil for no optional fields.

Fixes: #872

@SuperQ

SuperQ commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

👓 @rtreffer

Comment thread mountinfo_test.go
},
{
name: "9p Docker Desktop mount with space in super option path",
s: `3196 80 0:172 / /Docker/host rw,noatime - 9p C:\134Program\040Files\134Docker\134Docker\134resources rw,aname=drvfs;path=C:\Program Files\Docker\Docker\resources;symlinkroot=/mnt/,cache=5,access=client,msize=65536,trans=fd,rfd=3,wfd=3`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting case 0.o

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yup, Windows is weird.

The WSL2 mountinfo doesn't correctly escape paths in the super options
list. Refactor the parser to split the line in stages before and after
the ` - ` separator. This makes the parsing logic simpler since we don't
need to track the separator index anymore.
* Fix a small bug in the option parser that doesn't deal with multiple `=`
  chars in the comma-separated option strings.
* Fix `OptionalFields` to always return an empty map rather than nil for
  no optional fields.

Fixes: #872

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ
SuperQ force-pushed the superq/fix_mountinfo_parse branch from 4ab99ae to 186969c Compare October 19, 2026 14:23
@SuperQ
SuperQ merged commit eecec32 into master Oct 19, 2026
7 checks passed
@SuperQ
SuperQ deleted the superq/fix_mountinfo_parse branch October 19, 2026 14:34
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