nullfs: ensure correct lock is taken after bypass.
authorkib <kib@FreeBSD.org>
Mon, 19 Oct 2020 19:23:22 +0000 (19:23 +0000)
committerkib <kib@FreeBSD.org>
Mon, 19 Oct 2020 19:23:22 +0000 (19:23 +0000)
commit702b531de7afdc9940cc3fa27cb34de28e7feaff
tree5207c22980d86dac4928028dfeb5d96d00cec5f7
parentc7f71f3e533bf925bfafaf38c618f25e52a2952d
nullfs: ensure correct lock is taken after bypass.

If lower VOP relocked the lower vnode, it is possible that nullfs
vnode was reclaimed meantime.  In this case nullfs vnode no longer
shares lock with lower vnode, which breaks locking protocol.

Check for the condition and acquire nullfs vnode lock if detected.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
sys/fs/nullfs/null_vnops.c