VFS messaging/interfacing work stage 7f/99: More firming up of stage 7.
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 7 Oct 2004 04:20:28 +0000 (04:20 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 7 Oct 2004 04:20:28 +0000 (04:20 +0000)
commitb8997912a701f8b228466a16d61d07a42e66bd32
tree362369b8e9f35a631920d529d6ba6a2bfe2a1eb7
parentf46ff2216618349feeaeac9818efdd1928733586
VFS messaging/interfacing work stage 7f/99: More firming up of stage 7.

unlink, rmdir, rename, and whiteout removal functions use NAMEI_DELETE
namei() lookups.  With the old API this zap'd the namecache entry before
the system actually runs the operation.  If the operation fails we can be
left with a broken namecache hierarchy which is not allowed in the new API.

Change old API cache_lookup() semantics to *NOT* zap the namecache entry and
add explicit zaps after calls to VOP_UNLINK(), VOP_RMDIR(), etc. to replace
the functionality.

rename() attempts to issue a NAMEI_RENAME lookup which zaps the target, but
the same problem occurs if the target is preexisting and being overwritten.
A similar solution is employed for renames.
sys/kern/vfs_cache.c
sys/kern/vfs_default.c
sys/kern/vfs_lookup.c
sys/kern/vfs_syscalls.c
sys/vfs/nfs/nfs_serv.c
sys/vfs/ufs/ufs_vnops.c