HomeFreeBSD

unionfs: prevent upperrootvp from being recycled during mount

Description

unionfs: prevent upperrootvp from being recycled during mount

If upperrootvp is doomed by a concurrent unmount, unionfs_nodeget()
may return without a reference or lock on it. unionfs_domount() must
prevent the vnode from being recycled for use by a different file until
it is finished with the vnode, namely once vfs_register_upper_from_vp()
fails. Accomplish this by holding the reference returned by namei()
a bit longer.

Reviewed by: kib, markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D39767

Details

Provenance
jahAuthored on Mar 26 2023, 1:41 AM
Reviewer
kib
Differential Revision
D39767: Various fixes to unionfs error handling logic
Parents
rG080917298512: unionfs: fixes to unionfs_nodeget() error handling
Branches
Unknown
Tags
Unknown