HomeFreeBSD

vgonel(): avoid recursing into VOP_INACTIVE().

Description

vgonel(): avoid recursing into VOP_INACTIVE().

It is a common pattern for filesystems' VOP_INACTIVE() implementation
to forcibly reclaim the vnode when its state is final. For instance,
UFS vnode with zero link count is removed, and since it is
inactivated, the last open reference on it is dropped.

On the other hand, vnode might get spurious usecount reference for
many reasons. If the spurious reference exists while vgonel() checks
for active state of the vnode, it would recurse into VOP_INACTIVE().

Fix it by checking and not doing inactivation when vgone() was called
from inactive VOP.

Reported and tested by: pho
Discussed with: mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on
Parents
rS366847: uma: fix KTR message after r366840
Branches
Unknown
Tags
Unknown