Files
erofs-freebsd-out-tree/tests/TC017-48bit-blocks-parse.md
T
2026-08-13 10:44:59 +02:00

1.6 KiB

Test Case: 48-bit Block Count Parsing

Test ID: TC017-48bit-blocks-parse Category: Filesystem Metadata Priority: Medium

Objective

Verify the Linux EROFS union rule dynamically: with incompat bit 0x80 and a nonzero rootnid_8b, combine blocks_lo with rb.blocks_hi << 32 and preserve the complete count through mount.

Fixture Qualification

work=$(mktemp -d /tmp/repo22-tc017.XXXXXX)
tests/prepare_error_fixtures.sh "$work/fixtures"
python3 tests/erofs_fixture.py inspect \
  "$work/fixtures/48bit-statfs-prefix.erofs"
od -An -tx2 -j 1038 -N 2 "$work/fixtures/48bit-statfs-prefix.erofs"
od -An -tx4 -j 1060 -N 4 "$work/fixtures/48bit-statfs-prefix.erofs"
od -An -tx8 -j 1136 -N 8 "$work/fixtures/48bit-statfs-prefix.erofs"
grep '^48bit-statfs-prefix ' "$work/fixtures/fixture-evidence.txt"

Require blocks_hi=1, rootnid_8b != 0, a valid recomputed CRC, and a recorded prefix SHA256. The expected count is blocks_lo | (1 << 32).

FreeBSD Procedure

Create and attach the sparse provider exactly as in TC010. Record diskinfo, mount it read-only, compare df -k total with total_blocks * 4, read control.txt, then unmount and detach the dynamic md unit.

Also attach the unextended small prefix once and require mount failure with ENXIO; record this only as the negative media-size guard, not the positive parse result.

Expected Results

The sparse provider mount succeeds and reports the full nonzero-high-word count. The small prefix fails ENXIO. If no qualifying provider can be attached, record the metadata parsing evidence separately and mark the dynamic portion SHELVED, never PASS.