# Test Case: Readdir Cookies and seekdir Resume **Test ID**: TC048-readdir-seek **Category**: Directory Operations **Priority**: Critical ## Objective Verify every kernel d_off and libc telldir cookie resumes at the next exact entry; complete second traversals are not substitutes. ## Procedure Mount metadata/namei-base.erofs and run: ./readdir_probe /tmp/repo22-g3/mnt/wide 128 | tee TC048-probe.out ## Probe Contract The helper fails on non-increasing cookies, invalid records, duplicate names, kernel/libc order or type differences, a restart at the wrong next name, or a final cookie that does not reach EOF. Kernel d_off values are validated after reopen/lseek; each libc telldir value is passed back to seekdir on the same DIR stream that produced it, as required by the API contract. ## Expected Results The helper exits zero and reports entries=322, d_off_restarts=322, seekdir_restarts=322, buffer=128, the type counts, and one FNV-1a name/type hash. Record literal output and cleanup.