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>
Tue, 26 Jul 2016 20:01:27 +0000 (13:01 -0700)
commitf0181d639ee52912b16d8015eb5304001f04a3e2
treef5ccd39611c13c3c139545ea6da54b92e8de2f52
parentee89e80ba8c2a7ec5abadda658ca674775f61949
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