git: devfs - Fix a few more issues (3)

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Mar 18 22:00:11 PDT 2018


commit 731fd4cce0c74e1622ca2d149ee5f4cc8e3adb11
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Mar 18 21:57:29 2018 -0700

    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().

Summary of changes:
 sys/vfs/devfs/devfs_core.c  | 39 +++++++++++++++++++++++++++++----------
 sys/vfs/devfs/devfs_vnops.c | 15 +++++++++++----
 2 files changed, 40 insertions(+), 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/731fd4cce0c74e1622ca2d149ee5f4cc8e3adb11


-- 
DragonFly BSD source repository



More information about the Commits mailing list