1.6 KiB
1.6 KiB
Test Case: Special Vnode Combined Setattr Rejection
Test ID: TC159-special-setattr-combinations Category: Read-Only Vnode Operations Priority: Critical Regression: A special-vnode size field caused early success and hid other requested mutations
Objective
Verify that size-only setattr remains an ignored no-op for special vnodes, while
a single VOP_SETATTR containing size plus mode, ownership, timestamps, or all
three classes returns EROFS.
Fixture and Probe
Use special-setattr.erofs and its FIFO /special.fifo. Build the kernel-side
probe against the same FreeBSD 15 source tree:
mkdir setattr-probe
cp tests/final_review_setattr_probe.c setattr-probe/
cp tests/final_review_setattr_probe.mk setattr-probe/Makefile
make -C setattr-probe SYSDIR=/path/to/freebsd/sys
The probe performs one locked vnode lookup and one VOP_SETATTR per sysctl
trigger, avoiding userspace syscalls that split attributes across operations.
Procedure
- Mount the fixture read-only and record mode, uid, gid, atime, and mtime.
- Load
erofs_setattr_probe.koand setdebug.erofs_setattr_probe.pathto the FIFO. - Trigger operation 1 (size only); require result 0.
- Trigger operations 2 through 5 (size+mode, size+owner, size+times, all);
require result 30 (
EROFS) after each trigger. - Require the metadata snapshot to remain unchanged, then unload the probe, unmount, detach, and unload EROFS.
Expected Results
- Size-only special-vnode setattr returns 0.
- Every combined mutation returns
EROFS, never false success. - No mode, ownership, or timestamp changes are observable.