git: kernel - Fix namecache leak / broken hysteresis

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Mar 23 16:32:43 PDT 2018


commit 5eeee54a302a9f7e6369aeef740ac702708229f2
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Mar 23 16:18:22 2018 -0700

    kernel - Fix namecache leak / broken hysteresis
    
    * We were double-using NCF_DESTROYED for both dummy ncp's for
      list iteration and to indicate a removed ncp.  This prevented
      the hysteresis code from properly cleaning up such ncp's.
    
      Symptoms were growing stalls every few seconds on one cpu as
      the hysteresis code would try to futiley clean up excess
      namecache entries.
    
    * Use NCF_DUMMY instead of NCF_DESTROYED to check for dummy
      list iterators in the hysteresis code, allowing it to process
      NCF_DESTROYED ncps.
    
    * These ncps could accumulate only in situations where the vnode
      nlinks count is greater than 1, since a file deletion when nlinks
      is 1 will delete the vnode and all related ncp's.
    
      When nlinks is greater than 1, a file entry deletion does not
      necessarily cause the vnode to be deleted, leaving the namecache
      records intact, but flagged NCF_DESTROYED, and prevented the
      hystersis code from operating correctly.
    
    Reported-by: ftigeot

Summary of changes:
 sys/kern/vfs_cache.c | 12 ++++++++----
 sys/sys/namecache.h  |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5eeee54a302a9f7e6369aeef740ac702708229f2


-- 
DragonFly BSD source repository



More information about the Commits mailing list