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
F171003177: D21864.id62809.diff
Tue, Sep 8, 3:20 AM
F171000221: D21864.diff
Tue, Sep 8, 2:52 AM
F170991478: D21864.id62837.diff
Tue, Sep 8, 1:33 AM
F170969179: D21864.id62807.diff
Mon, Sep 7, 10:26 PM
Unknown Object (File)
Sun, Sep 6, 1:22 AM
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
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