kernel - Fix namecache race & panic
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 26 Jul 2016 20:01:27 +0000 (13:01 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 27 Jul 2016 00:21:28 +0000 (17:21 -0700)
commit4d65990f79d76e7e9b8ddea86f04d8a19549527a
treeb8eaabd98aa3dacf782493c95ec3bfbe1ac8b7a5
parente1bff962bff1ed6f5d4d19d3c6867d58fda7cfee
kernel - Fix namecache race & panic

* Properly lock and re-check the parent association when iterating its
  children, fixing a bug in a code path associated with unmounting
  filesystems.

  The code improperly assumed that there could be no races because there
  are were no accessors left.  In fact, under heavy loads, the namecache
  scan in this routine can race against the negative-name-cache management
  code.

* Generally speaking can only happen when lots of mounts and unmounts are
  done under heavy loads (for example, tmpfs mounts during a poudriere or
  synth run).
sys/kern/vfs_cache.c
sys/kern/vfs_nlookup.c