From: semarie Date: Tue, 19 Apr 2022 15:30:52 +0000 (+0000) Subject: add missing unlock before returning in uvn_detach() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dc57f0abf248f41f686b541d07a1322bc2e97c28;p=openbsd add missing unlock before returning in uvn_detach() uvn_detach sets UVM_VNODE_RELKILL flag and wait for all async i/o to finish. but uvm_vnp_terminate() could clear the flag and take over the vnode. mpi@ noted that this code path is mostly dead code because there is no "async I/O" (uvn_io() is always synchronous). ok visa@ mpi@ --- diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index c9e7dd63288..3f3de38b7c5 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_vnode.c,v 1.121 2021/12/15 12:53:53 mpi Exp $ */ +/* $OpenBSD: uvm_vnode.c,v 1.122 2022/04/19 15:30:52 semarie Exp $ */ /* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */ /* @@ -358,8 +358,10 @@ uvn_detach(struct uvm_object *uobj) INFSLP); } - if ((uvn->u_flags & UVM_VNODE_RELKILL) == 0) + if ((uvn->u_flags & UVM_VNODE_RELKILL) == 0) { + rw_exit(uobj->vmobjlock); return; + } /* * kill object now. note that we can't be on the sync q because