devfs - Fix a few more issues (3)
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 19 Mar 2018 04:57:29 +0000 (21:57 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 19 Mar 2018 04:57:29 +0000 (21:57 -0700)
commit731fd4cce0c74e1622ca2d149ee5f4cc8e3adb11
tree92cb4004e41a8d7d195732ee33dba748c970ebfd
parent9b444d7bba1ca15869ffb11c9b84051fe6db98f7
devfs - Fix a few more issues (3)

* devfs_unlinkp() was improperly setting node->v_node to NULL,
  which messes up certain interlocks for race avoidance.

* Use vhold()/vdrop() instead of vref()/vrele() to prevent
  vnode destruction during node teardown.  The node can be
  torndown with an unreferenced vnode.  vref() will panic if
  the refcnt is not already > 0.

* Refactor devfs_vop_reclaim() a bit.  Do not interpose the
  v_release_rdev() call between the node check and the call
  to devfs_freep().
sys/vfs/devfs/devfs_core.c
sys/vfs/devfs/devfs_vnops.c