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

1.7 KiB

Pre13 H03b: qstr block and dirent search

Scope

  • Converted find_target_dirent() and erofs_find_target_block() to accept a bounded struct erofs_qstr search key.
  • Constructed bounded on-disk qstr objects from the same validated dirent name offsets and block end pointers used before this change.
  • Constructed a temporary search qstr inside erofs_namei() while retaining its original pointer/length external interface for H03c.
  • Removed the H03a legacy comparator adapter.

No changes were made to dir.c, readdir, cookies, buffer ownership, directory validation, binary-search decisions, errno selection, cleanup, VOP lookup, vnode locking, or namecache operations.

Static evidence

  • erofs_dirnamecmp() has exactly two call sites: the block-level first-name comparison and the candidate block's dirent comparison.
  • Both on-disk qstr end pointers use the same next nameoff or validated block boundary as the previous pointer arguments.
  • erofs_find_target_block() retains every erofs_brelse() path, candidate replacement, EINTEGRITY assignment, and ENOENT distinction.
  • erofs_namei() still releases the selected block once and returns ENOENT only for a true miss.
  • The erofs_lookup() control flow and all cache_enter(), vn_vget_ino(), erofs_vget(), and cn_lkflags uses are outside this stage's diff.

Comparator gate

Tests baseline: ce03c283e6e2cb8f1b69c8eff21f7d06098a4fbe.

  • Python deterministic corpus: PASS, 11,562 cases.
  • Independent C harness: PASS, 1,048,576 cases.

The comparator gates are host static-equivalence evidence, not dynamic feature tests. H03 still requires TC042, TC043, TC044, TC045, TC053, TC054, TC123, TC141, and TC148, followed by the final smoke test.