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
F144597601: D47936.diff
Tue, Feb 10, 1:59 AM
Unknown Object (File)
Sun, Feb 8, 12:23 AM
Unknown Object (File)
Sat, Feb 7, 6:07 PM
Unknown Object (File)
Sat, Jan 31, 7:27 AM
Unknown Object (File)
Sat, Jan 24, 7:45 PM
Unknown Object (File)
Dec 9 2025, 9:15 AM
Unknown Object (File)
Nov 30 2025, 11:45 AM
Unknown Object (File)
Nov 25 2025, 9:22 PM
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