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
Unknown Object (File)
Wed, Oct 8, 3:52 AM
Unknown Object (File)
Sun, Sep 28, 2:35 AM
Unknown Object (File)
Sat, Sep 27, 10:45 PM
Unknown Object (File)
Wed, Sep 24, 4:42 PM
Unknown Object (File)
Sep 20 2025, 4:06 PM
Unknown Object (File)
Sep 11 2025, 7:24 PM
Unknown Object (File)
Sep 10 2025, 10:10 PM
Unknown Object (File)
Sep 10 2025, 2:46 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