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)
Wed, May 21, 8:41 PM
Unknown Object (File)
Sun, May 11, 9:01 PM
Unknown Object (File)
Apr 29 2025, 8:06 PM
Unknown Object (File)
Apr 27 2025, 4:26 AM
Unknown Object (File)
Apr 22 2025, 7:08 PM
Unknown Object (File)
Apr 20 2025, 1:41 PM
Unknown Object (File)
Apr 20 2025, 12:18 PM
Unknown Object (File)
Apr 20 2025, 12:15 PM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable