Skip to content

Conversation

@imlk0
Copy link
Collaborator

@imlk0 imlk0 commented Feb 5, 2026

Introduce has_valuable_data() to better determine whether a block device contains meaningful filesystem data:

  • When an expected filesystem type (fs_hint) is provided, it strictly checks for that type and errors if something else is detected.
  • Without a hint, it treats known partition tables like PTTYPE="atari" as non-valuable (workaround for util-linux bug), while considering any other detected signature as valuable data.
  • Update callers in cryptpilot-crypt and tests to use the new logic, flipping boolean expectations accordingly.

This improves safety during volume initialization by avoiding accidental overwrites of unexpected but valid data.

Introduce `has_valuable_data()` to better determine whether a block device contains meaningful filesystem data:

- When an expected filesystem type (`fs_hint`) is provided, it strictly checks for that type and errors if something else is detected.
- Without a hint, it treats known partition tables like `PTTYPE="atari"` as non-valuable (workaround for util-linux bug), while considering any other detected signature as valuable data.
- Update callers in `cryptpilot-crypt` and tests to use the new logic, flipping boolean expectations accordingly.

This improves safety during volume initialization by avoiding accidental overwrites of unexpected but valid data.

Signed-off-by: Kun Lai <laikun@linux.alibaba.com>
@imlk0 imlk0 merged commit f1a1c81 into master Feb 6, 2026
22 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.

1 participant