git: tmpfs - Fix rare deadlock

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Aug 29 08:27:45 PDT 2018


commit d89a0e31a842d13f34830f543170e9d31a70afd9
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Aug 25 10:10:08 2018 -0700

    tmpfs - Fix rare deadlock
    
    * Fix a deadlock which can occur between umount and tmpfs, and
      possibly in other very rare situations.
    
    * tmpfs holds the directory node locked when resolving a directory
      entry.  This results in a lock order reversal between the
      directory's tmpfs_node lock and the vnode being locked.
    
      Fixed by using a NOWAIT/UNLOCK/SLEEPFAIL/RETRY sequence.

Summary of changes:
 sys/vfs/tmpfs/tmpfs.h        |  4 ++--
 sys/vfs/tmpfs/tmpfs_subr.c   | 49 ++++++++++++++++++++++++++++++++++----------
 sys/vfs/tmpfs/tmpfs_vfsops.c |  5 +++--
 sys/vfs/tmpfs/tmpfs_vnops.c  | 11 +++++++---
 4 files changed, 51 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d89a0e31a842d13f34830f543170e9d31a70afd9


-- 
DragonFly BSD source repository


More information about the Commits mailing list