Files
erofs-freebsd-out-tree/docs/pre12-batch-05.md
T
2026-08-18 09:20:44 +02:00

1.3 KiB

Pre12 Batch 05: ZSTD window lower bound

Change

  • Removed only the rq->em->zstd_windowlog + 10 < 10 subcondition from z_erofs_zstd_decompress.
  • Preserved the > 20 upper bound, the outputsize == 0 check, every return (-1), all ZSTD calls, resource release, and the complete disabled #else stub.
  • Did not change ZSTD configuration parsing, accepted configuration range, conditional compilation, errno behavior, or control flow after the guard.

Static proof

  • struct erofs_mount.zstd_windowlog is uint8_t, so integer promotion gives a value in the range 0 through 255.
  • Adding 10 therefore produces a minimum value of 10; comparison with < 10 is unreachable for every representable field value.
  • z_erofs_load_zstd_config still rejects windowlog > 10, so configured mount values and the remaining decompression upper-bound behavior are unchanged.
  • Normalized function comparison confirms that the only removed logical tokens are the single unreachable lower-bound subcondition and its ||.
  • git diff --check and git diff --cached --check completed without errors.

Tests not run

Per the execution constraints, no build, QEMU run, smoke test, feature test, or other dynamic test was run. A FreeBSD KLD build with WITH_ZSTDIO=1 remains mandatory during final validation so this enabled function body is compiled.