Page MenuHomeFreeBSD

fifos: delegate unhandled kqueue filters to underlying filesystem
ClosedPublic

Authored by kevans on Oct 2 2021, 6:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 14, 5:42 AM
Unknown Object (File)
Mon, May 27, 6:07 PM
Unknown Object (File)
Sun, May 26, 7:17 AM
Unknown Object (File)
Sat, May 18, 2:35 AM
Unknown Object (File)
May 4 2024, 12:32 PM
Unknown Object (File)
May 1 2024, 10:47 PM
Unknown Object (File)
Apr 28 2024, 11:48 PM
Unknown Object (File)
Apr 28 2024, 2:17 AM
Subscribers

Details

Summary

This gives the vfs layer a chance to provide handling for EVFILT_VNODE,
for instance. Change pipe_specops to use the default vop_kqfilter to
accommodate fifoops that don't specify the method (i.e. all in-tree).

Based on a patch by Jan Kokemüller.

PR: 225934

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41916
Build 38804: arc lint + arc unit

Event Timeline

vop_stdkqfilter is the default.

sys/fs/fifofs/fifo_vnops.c
86

I had considered adding a small fifo_kqfilter that asserts we don't get any EVFILT_READ/EVFILT_WRITE since these should either be rejected by or handled by pipe_kqfilter, but I'm not sure.

This revision is now accepted and ready to land.Oct 2 2021, 11:19 AM

I wonder if it would be useful to support the same thing for bound unix sockets.

sys/fs/fifofs/fifo_vnops.c
86

Perhaps instead modify vfs_kqfilter() to assert vp->v_type != VFIFO || kn->kn_filter == EVFILT_VNODE. I don't have any particular objection to adding an INVARIANTS-only VOP though.

sys/fs/fifofs/fifo_vnops.c
86

I guess that raises another question- should this have been scoped to just passing through EVFILT_VNODE? It doesn't seem like there's anything in particular preventing us from passing along a (bogus) EVFILT_PROCDESC or EVFILT_EMPTY

sys/fs/fifofs/fifo_vnops.c
86

It seems a bit more maintainable to simply pass unknown filters through to vop_kqfilter(), rather than trying to second-guess the implementation, especially since VOP_KQFILTER could be overridden by a fs that implements custom filters. (OneFS does exactly this, in fact.) The assertion can simply verify that the filter is not EVFILT_READ or _WRITE.