Page MenuHomeFreeBSD

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

Authored by markj on Oct 1 2019, 8:19 PM.



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

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj created this revision.Oct 1 2019, 8:19 PM
mjg added a subscriber: mjg.Oct 1 2019, 8:31 PM
mjg added inline comments.
791 ↗(On Diff #62807)

vnode is assigned the line prior

markj updated this revision to Diff 62809.Oct 1 2019, 8:34 PM

Address mjg's note.

kib accepted this revision.Oct 1 2019, 9:14 PM
This revision is now accepted and ready to land.Oct 1 2019, 9:14 PM
This revision was automatically updated to reflect the committed changes.