git: DragonFly_RELEASE_5_4 kernel - Improve umount operation

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Dec 17 13:55:56 PST 2018


commit 155955f080115ec6ebd3f244be767c2c7ef01f66
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Dec 6 18:50:07 2018 -0800

    kernel - Improve umount operation
    
    * Move the cache_inval(), and both cache_unmounting() and
      cache_clearmntcache() into the retry loop.  This ensures that
      the nc_refs test actually has a chance to update during the retry.
    
      This should significantly improve umount operation, reducing umount
      races against exiting processes still using the filesystem.
    
    * Only issue the allproc scan which matches and clears proc->p_textnch
      on a forced umount.  Otherwise disallow the umount attempt.  We
      may have to reallow this later, but the shutdown code now properly
      clears p_textnch so it should take care of the case for us (which
      is why this code was originally present).
    
    * Properly dispose of p->p_textnch during shutdown/halt/reboot for
      the calling process, proc0, and init.  This is an attempt to allow
      the system to cleanly unmount root.
    
    * Cleanup the warning and error messages to clarify umount failures.
    
    * Only reinstasll the syncer vp on error if umount deinstalled it.
    
    * Add some debugging sysctls (default disabled).
    
    Reported-by: marino

Summary of changes:
 sys/kern/kern_shutdown.c |   2 +
 sys/kern/vfs_mount.c     |  19 ++++---
 sys/kern/vfs_syscalls.c  | 138 ++++++++++++++++++++++++++++-------------------
 3 files changed, 95 insertions(+), 64 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/155955f080115ec6ebd3f244be767c2c7ef01f66


-- 
DragonFly BSD source repository


More information about the Commits mailing list