Fix an issue with cache_rename(). This procedure previously copied a
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 18 Jan 2008 19:13:16 +0000 (19:13 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 18 Jan 2008 19:13:16 +0000 (19:13 +0000)
commit227cf16dc6ab4a015184935c548bd1f921f935ac
tree307cd2aed1a5af76df9b70cbc740c86cb801f32e
parent47baf79adb45d97bff954a7e5e36974caf11085a
Fix an issue with cache_rename().  This procedure previously copied a
namecache entry to a new one and then invalidated the old one, operating
under the idea that the namespace structures should remain consistent.
However, the curret, root, and jail directories for a process are stored as
pointers to namecache structures and renaming a directory resulted in
the current, root, or jail directory for related processes becoming invalid.

Changes to the namecache structure over the years (separately allocated
nc_name, rehash support, etc) now make it possible to implement the
cache_rename() by physically renaming the namecache structure instead
of copying it, allowing process references to be retained.

NOTE: There may still be a race against nlookup's.

Reported-by: Vincent Stemen <vs1@crel.us>
Testing-by: Vincent Stemen <vs1@crel.us>
sys/kern/vfs_cache.c
sys/kern/vfs_default.c