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)
Feb 6 2024, 10:55 AM
Unknown Object (File)
Jan 27 2024, 4:38 AM
Unknown Object (File)
Dec 24 2023, 7:33 PM
Unknown Object (File)
Dec 22 2023, 4:06 PM
Unknown Object (File)
Dec 20 2023, 6:23 AM
Unknown Object (File)
Dec 13 2023, 4:42 PM
Unknown Object (File)
Nov 17 2023, 9:35 PM
Unknown Object (File)
Oct 10 2023, 3:12 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.