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)
Feb 19 2024, 5:33 PM
Unknown Object (File)
Jan 20 2024, 4:11 PM
Unknown Object (File)
Dec 20 2023, 4:26 AM
Unknown Object (File)
Dec 18 2023, 10:13 AM
Unknown Object (File)
Nov 29 2023, 6:27 AM
Unknown Object (File)
Nov 29 2023, 3:04 AM
Unknown Object (File)
Oct 4 2023, 6:50 PM
Unknown Object (File)
Jul 21 2023, 3:12 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