HomeFreeBSD

vn_open_vnode(): handle error when fp == NULL

Description

vn_open_vnode(): handle error when fp == NULL

If VOP_ADD_WRITECOUNT() or adv locking failed, so VOP_CLOSE() needs to
be called, we cannot use fp fo_close() when there is no fp. This occurs
when e.g. kernel code directly calls vn_open() instead of the open(2)
syscall.

In this case, VOP_CLOSE() can be called directly, after possible lock
upgrade.

Reported by: nvass@gmx.com
PR: 255119
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29830

Details

Provenance
kibAuthored on Apr 19 2021, 10:25 AM
Differential Revision
D29830: vn_open_vnode(): handle error when fp == NULL
Parents
rG45aec46246fe: rc: make the 'linux' script explicitly load filesystem modules
Branches
Unknown
Tags
Unknown