Page MenuHomeFreeBSD

Disallow fcntl(F_READAHEAD) when the vnode is not a regular file.
ClosedPublic

Authored by markj on Oct 1 2019, 8:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 4, 4:23 PM
Unknown Object (File)
Fri, Sep 4, 11:49 AM
Unknown Object (File)
Tue, Aug 25, 3:13 AM
Unknown Object (File)
Sun, Aug 23, 8:42 PM
Unknown Object (File)
Fri, Aug 21, 1:20 PM
Unknown Object (File)
Fri, Aug 7, 4:35 AM
Unknown Object (File)
Aug 2 2026, 12:18 AM
Unknown Object (File)
Jul 30 2026, 9:14 AM
Subscribers

Details

Summary

f_iosize is 0 for devfs vnodes, resulting in a divide by zero if one
calls, for example, fcntl(STDIN_FILENO, F_READAHEAD, 4096).

The sequential heuristic is not applied to I/O to or from device files,
and posix_fadvise(2) returns an error for v_type != VREG, so do the same
here too.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26818
Build 25152: arc lint + arc unit