Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2019 16:52:00 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        "freebsd-arch@freebsd.org" <arch@freebsd.org>
Subject:   RFC: What to do about VOP_INACTIVE?
Message-ID:  <CAG6CVpU8J=G8za8W2uan8SAGEbe4PD=SXwMow=E_mkJnMGB96A@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpU8J=G8za8W2uan8SAGEbe4PD=SXwMow=E_mkJnMGB96A>