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
F136401913: D21864.id62809.diff
Mon, Nov 17, 3:11 PM
Unknown Object (File)
Sun, Nov 16, 12:43 AM
Unknown Object (File)
Sat, Nov 15, 8:38 PM
Unknown Object (File)
Sat, Nov 15, 5:39 AM
Unknown Object (File)
Thu, Nov 13, 5:51 AM
Unknown Object (File)
Tue, Nov 11, 4:42 AM
Unknown Object (File)
Mon, Nov 3, 1:17 PM
Unknown Object (File)
Mon, Nov 3, 12:53 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