Skip to content

fix(disk): ignore virtual loop, ram devices, and Waydroid container mounts - #5

Merged
kk376 merged 2 commits into
mainfrom
fix/disk-loop-container-filter
Nov 13, 2026
Merged

kk376 merged 2 commits into
mainfrom
fix/disk-loop-container-filter

Conversation

@kk376

@kk376 kk376 commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Problem

When container engines like Waydroid run, their rootfs and vendor image files are mounted as virtual loop devices (/dev/loop0, /dev/loop1) formatted as native ext4. Because ext4 is a standard physical filesystem type and loop devices were not filtered by device prefix, kkfetch displayed them as physical disk partitions (Disk2: (/var/lib/waydroid/rootfs), Disk3: (/var/lib/waydroid/rootfs/vendor)).

Solution

  1. Device-level virtual block device filtering: Ignores /dev/loop* and /dev/ram* in get_all_disks_with_usage. This skips virtual loopback mounts (such as Waydroid, mounted ISOs, or snap images) before any statvfs syscalls are made, preserving sub-2ms latency.
  2. Mount prefix filtering: Adds /var/lib/waydroid to IGNORED_MOUNT_PREFIXES alongside Docker, Podman/containers, and Flatpak directories.

Verification

  • Added hermetic regression test test_loop_and_waydroid_mounts_filtered in src/modules/disk.rs.
  • cargo test: all 286 unit and CLI tests pass.
  • cargo clippy --all-targets -- -D warnings: clean (0 warnings).
  • cargo fmt --check: clean.
  • Secret scan: clean (0 findings).
  • Local execution verified with --timings: execution latency remains ~1.46 ms with Waydroid mounts cleanly suppressed.

@kk376
kk376 merged commit e505404 into main Nov 13, 2026
7 checks passed
@kk376
kk376 deleted the fix/disk-loop-container-filter branch November 13, 2026 06:27
@kk376
kk376 restored the fix/disk-loop-container-filter branch November 13, 2026 06:28
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.

1 participant