Call vget(9) in uvn_put() to make sure we hold a reference if we're called
authorkettenis <kettenis@openbsd.org>
Thu, 8 Dec 2022 21:32:48 +0000 (21:32 +0000)
committerkettenis <kettenis@openbsd.org>
Thu, 8 Dec 2022 21:32:48 +0000 (21:32 +0000)
commitb8f3f99a4673846ff4291a8bc35d93e8f06f46bf
treebf6850a8aabfdd1c5aba810d3b9428827c882e9e
parent7bb2cb9ad563d4c150c494fbe0ec75f5be7707d0
Call vget(9) in uvn_put() to make sure we hold a reference if we're called
by the pagedaemon for a persisting vnode.  This prevents a panic in
uvm_vnp_unache() since a persisting vnode has a reference count of zero.
This should also prevent the vnode from being recycled from under our
feet while we're doing I/O to it.

This fixes the "macppc panic: vref used where vget required" issue.

tested by bluhm@, tb@
ok mpi@
sys/uvm/uvm_vnode.c