Skip to content

Comments

[linux][disk]: fix disk mountinfo parsing bug#2007

Open
shirou wants to merge 1 commit intomasterfrom
fix/fix_disk_mountinfo_parsing_bugs
Open

[linux][disk]: fix disk mountinfo parsing bug#2007
shirou wants to merge 1 commit intomasterfrom
fix/fix_disk_mountinfo_parsing_bugs

Conversation

@shirou
Copy link
Owner

@shirou shirou commented Feb 23, 2026

This PR fixes those 3 bugs in seenDevIDs logic in parseFieldsOnMountinfo() which are introduced #1931. fixes #2005.

  1. Device field cascading - Previously stored mountPoint in seenDevIDs and overwrote on every occurrence, causing wrong Device values. Now stores the device path and only on first occurrence.
  2. Missing bind on first bind mount - Previously only detected bind when a device was seen before. Now uses rootDir != "/" as the primary signal, which correctly identifies subdirectory mounts.
  3. Incorrect bind on root mount - Previously marked any repeated device as bind. Now the root mount (rootDir == "/") is correctly left as non-bind even if the device was seen before.
  4. Edge case: virtual filesystems - Added strings.HasPrefix(mntSrc, "/") guard so virtual filesystems like nsfs (where rootDir is an identifier like net:[12345], not a path) aren't falsely marked as bind mounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Various disk mountinfo parsing bugs on Linux introduced by #1931

1 participant