2.6 KiB
Pre11 Batch E: Mount Device Argument Cleanup
Scope
This batch consolidates caller-owned device.N argument cleanup in
erofs_mount() and removes two impossible allocation checks. It does not
change mount option semantics, GEOM ownership, device slot validation, mount
error text, or any filesystem behavior.
Modified files:
src/super.cdocs/pre11-batch-e.md
Changes
After erofs_parse_device_options() succeeds, every exit from
erofs_mount() now reaches one out_args label. Parse failure still returns
directly because no caller-owned argument array has been transferred.
The operation order remains:
erofs_parse_device_options()vfs_filteropt()vfs_getopt()erofs_open_device()erofs_update_iosize_max()erofs_mountfs()erofs_free_device_args()vfs_mountedfrom()erofs_statfs()
out_args only frees copied device arguments. It does not inspect or release
primary. The existing erofs_mountfs() ownership transfer and all GEOM
cleanup paths remain unchanged.
The checks for NULL immediately following allocation of packed_inode and
metabox_en were removed. Both allocations retain M_WAITOK | M_ZERO, so a
successful return cannot produce NULL. No other allocation checks or flags
were changed.
Ownership Paths
| Path | Copied arguments | Primary device | Result |
|---|---|---|---|
| Parse failure | No caller ownership | Not opened | Return parser error directly |
| Option filter failure | Freed at out_args |
Not opened | Return EINVAL |
Invalid or missing from |
Freed at out_args |
Not opened | Return EINVAL |
| Primary open failure | Freed at out_args |
Open helper retains its existing cleanup contract | Return open error |
| Mount setup failure | Freed at out_args |
Ownership already transferred at erofs_mountfs() entry |
Return mount error |
| Success | Freed at out_args |
Owned by the mounted filesystem | Publish mounted-from and run statfs() |
Static Verification
erofs_free_device_args()has one caller after the change.erofs_mountfs()anderofs_sb_free()are unchanged.- The relative order of option filtering, option access, primary open, I/O sizing, mount setup, argument cleanup, mounted-from publication, and statfs is unchanged.
- Existing errno values and mount error strings are unchanged.
- Duplicate and missing external-device slot behavior is unchanged.
git diff --checkpasses.- The diff is restricted to the two declared Batch E files.
Validation Status
No build, QEMU smoke test, or feature test was run for this batch. Runtime validation is deferred to the final Pre11 build and targeted smoke test.