Page MenuHomeFreeBSD

Add _Static_asserts to check that file system fid structures are not larger than struct fid
ClosedPublic

Authored by rmacklem on Dec 5 2024, 11:31 PM.
Tags
None
Referenced Files
F151288831: D47936.id147554.diff
Tue, Apr 7, 8:43 AM
F151264114: D47936.diff
Tue, Apr 7, 4:54 AM
F151249374: D47936.id147557.diff
Tue, Apr 7, 2:57 AM
Unknown Object (File)
Mon, Apr 6, 7:55 AM
Unknown Object (File)
Tue, Mar 31, 10:35 PM
Unknown Object (File)
Tue, Mar 24, 5:17 AM
Unknown Object (File)
Mar 5 2026, 10:49 PM
Unknown Object (File)
Feb 10 2026, 1:59 AM
Subscribers

Details

Summary

File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct fid.

This patch adds _Static_assert()s to check for this.

ZFS and fuse already have _Static_assert()s.

Test Plan

Compiled the kernel with these _Static_assert()s.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable