Fix a stack overflow due to recursion. When the namecache must invalidate
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 26 Oct 2006 02:27:19 +0000 (02:27 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 26 Oct 2006 02:27:19 +0000 (02:27 +0000)
commitbf40a153b11e5308a6162c85c77808f6e4d72851
tree3ccd91ad19a1a65758cab9772f0ff31409226e99
parent1f7ab7c9fc18f47a2f16dc45b13dee254c603ce7
Fix a stack overflow due to recursion.  When the namecache must invalidate
an entire subtree the depth of the tree can cause the kernel stack to
overflow.  Implement a simple algorithm which limits the recursion depth.
When the recursion depth is reached the current namecache node is recorded
and further recursion does not occur.  The top level then recalls the
deletion at the recorded node, then restarts.

When removing a file or directory, invalidate all namecache records
associated with the vnode rather then just the one led to by the current
path.  Note that RENAME is not fixed and requires a more sophisticated
solution.  These fixes effect NULLFS.
sys/kern/vfs_cache.c
sys/kern/vfs_default.c