Skip to content

fix(space): exclude kernel pseudo filesystems from volume candidates - #106

Merged
tobi merged 1 commit into
tobi:mainfrom
bet4it:fix/filter-pseudo-volumes
Nov 25, 2026
Merged

tobi merged 1 commit into
tobi:mainfrom
bet4it:fix/filter-pseudo-volumes

Conversation

@bet4it

@bet4it bet4it commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What this does

In Linux, space::volumes() enumerates volume candidates for the volume picker (v dialog). Sub-mounts under /proc, /sys and /dev (such as /proc/sys/fs/binfmt_misc, /sys/fs/bpf or /sys/firmware/efi/efivars) as well as in-memory filesystems like ramfs were previously presented as selectable storage volumes because their filesystem types were not included in is_volume_candidate's blacklist.

This PR:

  1. Filters out mount points rooted under /proc, /sys and /dev, ensuring sub-mounts of kernel/device interfaces are never offered as scan roots.
  2. Explicitly adds binfmt_misc, bpf, efivarfs, and ramfs to the pseudo-filesystem blacklist in is_volume_candidate.
  3. Adds a unit test verifying that kernel pseudo-filesystems under /proc, /sys and /dev as well as ramfs are excluded while real storage volumes are preserved.

Verification

  • cargo xtask lint passes with 0 warnings.
  • cargo xtask test passes (all unit and window harness tests).

Sub-mounts under /proc, /sys and /dev (such as /proc/sys/fs/binfmt_misc,
/sys/fs/bpf and /sys/firmware/efi/efivars) as well as ramfs mounts
were previously not filtered out by is_volume_candidate because they have
their own filesystem types that were not part of the fstype blacklist.

Filter out mounts rooted under /proc, /sys or /dev, and explicitly
include binfmt_misc, bpf, efivarfs and ramfs in the pseudo filesystem
blacklist.
@bet4it
bet4it force-pushed the fix/filter-pseudo-volumes branch from f99fb16 to 8844977 Compare October 15, 2026 04:16
huntharo added a commit to pwrdrvr/PwrDisk that referenced this pull request Oct 31, 2026
* fix(space): exclude kernel pseudo filesystems from volume candidates

Sub-mounts under /proc, /sys and /dev (such as /proc/sys/fs/binfmt_misc,
/sys/fs/bpf and /sys/firmware/efi/efivars) as well as ramfs mounts
were previously not filtered out by is_volume_candidate because they have
their own filesystem types that were not part of the fstype blacklist.

Filter out mounts rooted under /proc, /sys or /dev, and explicitly
include binfmt_misc, bpf, efivarfs and ramfs in the pseudo filesystem
blacklist.

(cherry picked from commit 8844977)

* test(core): verify probe-free kernel mount discovery

---------

Co-authored-by: Bet4 <0xbet4@gmail.com>
@tobi
tobi merged commit 89483bf into tobi:main Nov 25, 2026
@bet4it
bet4it deleted the fix/filter-pseudo-volumes branch November 26, 2026 01:55
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.

2 participants