kernel - Fix namecache memory exhaustion edge case
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 23 Nov 2010 07:24:25 +0000 (23:24 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 23 Nov 2010 07:24:25 +0000 (23:24 -0800)
commit9e10d70bff3c00c19a8b841dccbcd6aa29100793
tree95598eee43a54f02a84f2f0d85f9ba773e9036e9
parent5502cf2442bc10db6925a4db0956131ae634ec95
kernel - Fix namecache memory exhaustion edge case

* The namecache has traditionally relied on vnode limits to avoid
  blowing up its memory pool.  However, creating millions of hardlinks
  to the same vnode easily circumvents this assumption.

* Enhance the negative cache hysteresis code with a section for the
  positive cache that does the same thing, preventing the namecache
  from growing greater than 2x maxvnodes.

  This situation will not occur under normal operation, it is strictly
  for correctness.  The kernel should never panic on normal filesystem
  operations even if those operations are unrealistic.

* Tested w/HAMMER and a few million hardlinks to a single file.

Reported-by: Venkatesh Srinivas <me@acm.jhu.edu>
sys/kern/vfs_cache.c