Skip to content

Fix repeated mount accounting and external SSD deletion guards - #44

Merged
tobi merged 4 commits into
mainfrom
mount-dedup-fix
Sep 27, 2026
Merged

tobi merged 4 commits into
mainfrom
mount-dedup-fix

Conversation

@tobi

@tobi tobi commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Files on a desktop-mounted USB disk under /run/media were blocked as system files. Allow deletion inside an independently mounted disk there, while preserving protection for the mount root, system disks, nested mounts, symlink targets, and ordinary /run directories. Read mount points and exceptions from one cached snapshot and recheck the exception on the removal worker.

Integrates #36 with its commit ancestry preserved. Mount deduplication now uses kernel device identity (with Btrfs subvolume handling), checks whether the original view is actually visible, and retains duplicate views containing separate mounts. Excluded paths cannot serve as the retained copy; hidden-entry and depth-limited scans keep all views.

Validation:

  • Native Windows cargo xtask lint and cargo xtask test: 201 tests passed.
  • Native Linux core tests: 121 passed; strict core clippy passed.
  • scripts/test-linux-mounts.sh: passed in a disposable user/mount namespace with real tmpfs and bind mounts. Covers independent filesystems, duplicate views, nested mounts, media deletion guards, symlinks, and preservation of unmarked files. The deletion test injects the disk classification because an unprivileged namespace cannot mount a block device; mount-table policy is covered separately.

Fixes #25.

@tobi
tobi merged commit 158f9cc into main Sep 27, 2026
6 checks passed
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.

external SSD misclassified as system files

2 participants