git: DragonFly_RELEASE_6_2 kernel - check nc_generation in nlookup path

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Nov 13 16:36:34 PST 2022


commit 6ca70e83cf5a7f3c6e1ee8a00f372d9ddb7048e7
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Jul 3 20:47:32 2022 -0700

    kernel - check nc_generation in nlookup path
    
    * With nc_generation now operating in a more usable manner, we can
      use it in nlookup() to check for changes.  When a change is detected,
      the related lock will be cycled and the entire nlookup() will retry up
      to debug.nlookup_max_retries, which currently defaults to 4.
    
    * Add debugging via debug.nlookup_debug.  Set to 3 for nc_generation
      debugging.
    
    * Move "Parent directory lost" kprintfs into a debugging conditional,
      reported via (debug.nlookup_debug & 4).
    
    * This fixes lookup/remove races which could sometimes cause open()
      and other system calls to return EINVAL or ENOTCONN.  Basically
      what happened was that nlookup() wound up on a NCF_DESTROYED entry.
    
    * A few minutes worth of a dsynth bulk does not report any random
      generation number mismatches or retries, so the code in this commit
      is probably very close to correct.

Summary of changes:
 sys/kern/vfs_cache.c    |  39 ++++++---
 sys/kern/vfs_nlookup.c  | 229 +++++++++++++++++++++++++++++++++++-------------
 sys/kern/vfs_syscalls.c |  10 ++-
 sys/kern/vfs_vnops.c    |   3 +
 sys/sys/namecache.h     |   2 +-
 5 files changed, 210 insertions(+), 73 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6ca70e83cf5a7f3c6e1ee8a00f372d9ddb7048e7


-- 
DragonFly BSD source repository


More information about the Commits mailing list