kernel - Fix two rare namecache bugs
commit5ecd24e2200bb7738582682e773ea5ec189d5e12
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 11 Feb 2018 06:11:18 +0000 (10 22:11 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 11 Feb 2018 06:11:18 +0000 (10 22:11 -0800)
tree079f0d2b9fc9f1f27d2055c6656b3898e4f8102d
parent7d46fb61088ed47662017256ab90183776c7e79f
kernel - Fix two rare namecache bugs

* Fix calculations which use the vfscache_negs global.  This global
  is somewhat heuristical and can values which are a bit off, including
  0.  Copy to a local and limit the range, fixing a divide-by-zero
  bug and a negative-number handling bug.

* Fix a bug in the handling of a race in _cache_cleanneg().  We were
  unlocking the ncp but failing to drop it, leaving it with a ref.
  The accumulating namecache records prevent umount from succeeding.

  This race can only occur regularly when kern.maxvnodes is set to
  a low value.
sys/kern/vfs_cache.c