git: kernel - Improve namecache generation handling

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Aug 31 20:32:11 PDT 2015


commit 75e479cfbd4b68bfdd0ce305ce40b9eb603bd587
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Aug 31 20:28:50 2015 -0700

    kernel - Improve namecache generation handling
    
    * Reduce mount->mnt_namecache_gen from 64 to 32 bits and add a dummy
      field so the structure size does not change.
    
    * Reduce namecache->nc_namecache_gen from 64 to 32 bits and add a
      second generation number to detect cache_unlink() and cache_rename()
      calls.  Bump the counter in cache_rename() and _cache_unlink().
      Structure size did not change.
    
    * Refactor kern_rename() to use namecache->nc_generation to detect
      a larger subset of changes to the namecache entries which can leak
      in due to the temporary unlock of fromnd->nl_nch.ncp.

Summary of changes:
 sys/kern/vfs_cache.c    |  7 ++++++-
 sys/kern/vfs_syscalls.c | 25 ++++++++++++++++++++++++-
 sys/sys/mount.h         |  3 ++-
 sys/sys/namecache.h     |  3 ++-
 4 files changed, 34 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/75e479cfbd4b68bfdd0ce305ce40b9eb603bd587


-- 
DragonFly BSD source repository


More information about the Commits mailing list