HomeFreeBSD

unionfs: rework unionfs_getwritemount()

Description

unionfs: rework unionfs_getwritemount()

VOP_GETWRITEMOUNT() is called on the vn_start_write() path without any
vnode locks guaranteed to be held. It's therefore unsafe to blindly
access per-mount and per-vnode data. Instead, follow the approach taken
by nullfs and use the vnode interlock coupled with the hold count to
ensure the mount and the vnode won't be recycled while they are being
accessed.

Reviewed by: kib (earlier version), markj, pho
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D34282

Details

Provenance
jahAuthored on Feb 15 2022, 3:52 AM
Reviewer
kib
Differential Revision
D34282: unionfs: rework unionfs_getwritemount()
Parents
rG5e2de1c11617: test-includes: temporarily add back net/pfvar.h
Branches
Unknown
Tags
Unknown