kernel - Improve namecache generation handling
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 1 Sep 2015 03:28:50 +0000 (20:28 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 1 Sep 2015 03:31:50 +0000 (20:31 -0700)
commit75e479cfbd4b68bfdd0ce305ce40b9eb603bd587
treeb9d5e02b05e85294032b96a78fbbb0bf69ed2abb
parent76f85faa70e0e580c2cf46832aaf462e53367731
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.
sys/kern/vfs_cache.c
sys/kern/vfs_syscalls.c
sys/sys/mount.h
sys/sys/namecache.h