RFC: What to do about VOP_INACTIVE?

Conrad Meyer cem at freebsd.org
Tue Feb 12 00:52:15 UTC 2019


Hello,

The nominal return type of the VOP_INACTIVE vnode method is 'int', but
in practice any error returned is silently discarded.

The only caller is vinactive(), which is also a void routine.
vinactive ignores the return value of VOP_INACTIVE().  (vinactive
tends to be called by other void routines, like vput(), so propagating
an error up the stack is non-trivial.)

In practice, most filesystems in the kernel unconditionally return
zero for INACTIVE.  The exceptions are: msdosfs, ext2fs, nandfs, and
(notably) ufs.

The problem (as I see it) is that the return type makes it appear that
INACTIVE is allowed to fail, but it is not.  One important
ramification of this is that interruptible sleeps in INACTIVE are
basically not permitted.

This seems problematic because INACTIVE is invoked as part of
close(2), and we can potentially block that user process indefinitely
when the kernel filesystem is stalled on a network resource, or
something like a FUSE userspace filesystem (which can also access
network resources).

Can we live with the current behavior (INACTIVE cannot fail)?  In that
case, I think we should change its return type to void to match.

Thoughts?

Thanks,
Conrad


More information about the freebsd-arch mailing list