file_scan: refuse unsupported-fs roots up front instead of failing silently - #97
Merged
Conversation
…lently When a seed root lived on a filesystem oans can't deduplicate (not btrfs or XFS), check_file() warned once but returned true, so the walk hashed every file only to have each FIEMAP/FIDEDUPERANGE fail with confusing per-file "Operation not supported" errors — and the run still exited 0 with "Nothing to deduplicate", looking like success. Refuse such a root at seed time via seed_reject() and print a clear "Skipping X: its filesystem is not btrfs or XFS" line. A run whose roots are *all* unsupported now trips the existing filescan_seed_failed() path (loud error, exit 1, no FIEMAP spam); a mix still scans the supported roots. locked_fs is committed only once the fs is confirmed supported, so a rejected root can't pollute the lock for a later supported root (the uuid now lands in a local first). This changes one behaviour: a filesystem that reports a UUID but isn't btrfs or XFS is now skipped rather than attempted. oans only deduplicates btrfs/XFS, so this turns a misleading success into an honest, actionable failure. Adds test_unsupported_fs.py (skips when the system temp dir happens to be a reflink fs). verify.sh green (91 tests + valgrind smoke). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
martinus
force-pushed
the
loud-unsupported-fs
branch
from
July 22, 2026 12:21
2447ea9 to
288d5ea
Compare
Owner
Author
|
Ran a /simplify pass and applied its findings:
The core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-launch robustness: make the "pointed oans at the wrong filesystem" case
honest, since it's a predictable first-touch mistake for new users.
The problem (observed)
Point oans at a directory on ext4/tmpfs and, on a modern kernel where
FS_IOC_GETFSUUIDsucceeds, it would:Warn: filesystem ... is not known to support deduplication(easily lost in progress output),
fiemap: Operation not supportedspam,Nothing to deduplicate— looking like success.(The other case — where
get_uuidoutright fails, e.g. older kernels — wasalready handled loudly by
filescan_seed_failed(); this fixes the modern"succeeds but unsupported" gap.)
The fix
In
check_file(), when the identified fs isn't btrfs/XFS, refuse the seed rootvia
seed_reject()with a clearSkipping X: its filesystem is not btrfs or XFSmessage instead of returningtrue. Consequences:filescan_seed_failed()path fires:loud error, exit 1, and no FIEMAP spam (the tree is never walked).
the message.
locked_fsis now committed only after the support check (the UUID landsin a local first), so a rejected root can't pollute the fs-lock for a later
supported root.
Behaviour change to note
A filesystem that reports a UUID but isn't btrfs or XFS is now skipped
rather than attempted. oans only deduplicates btrfs/XFS (via
FIDEDUPERANGE),so this converts a misleading exit-0 "success" into an honest, actionable
failure. If we ever want to support another dedupe-capable fs, add its magic to
is_fs_supported().Before / after (
oans -dron a tmpfs dir)Before:
Warn:+fiemap: Operation not supported×N +Nothing to deduplicate, exit 0.After:
Skipping <dir>: its filesystem is not btrfs or XFS ...+Error: could not determine the filesystem for any given path ..., exit 1, no FIEMAP spam.Testing
tests/integration/test_unsupported_fs.py(skips when the system tempdir happens to be a reflink fs).
scripts/verify.shgreen: clean build, 91 tests, valgrind scan+dedupe+replaysmoke clean.
🤖 Generated with Claude Code