Skip to content

Fixing deviceOf - #22

Merged
thegreystone merged 1 commit into
mainfrom
linux-issues
Jun 7, 2026
Merged

thegreystone merged 1 commit into
mainfrom
linux-issues

Conversation

@thegreystone

Copy link
Copy Markdown
Owner

This fixes the accounting problem of #21.

Copilot AI review requested due to automatic review settings June 7, 2026 23:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect cross-mount filtering in the parallel directory scanner by correctly parsing the POSIX fileKey device ID as hexadecimal, preventing the scan from descending into virtual filesystems like /proc on Linux (issue #21).

Changes:

  • Parse fileKey’s dev= field explicitly as base-16 instead of using Long.decode.
  • Make deviceOf package-private to enable direct regression testing.
  • Add JUnit regression tests covering letter-containing hex devices, digit-only devices, and unparseable inputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/se/hirt/diskspace/scan/ParallelDirectoryScanner.java Fixes device ID parsing to keep root-device filtering enabled on Linux/macOS/BSD POSIX file keys.
src/test/java/se/hirt/diskspace/scan/ParallelDirectoryScannerTest.java Adds regression tests to ensure deviceOf parses hex correctly and fails safely.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thegreystone
thegreystone merged commit 8f29d22 into main Jun 7, 2026
5 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.

2 participants