From 85e11dad62e1ede6b8d1ffc5caead7abbb7d6ff5 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 22 Jan 2017 08:36:23 -0800 Subject: [PATCH] kernel - Fix NFS sillyrename code * Due to the delayed vnode reclamation changes done several years ago the NFS client code was not properly removing silly-renamed files on last-close (these are files which NFS renames to .nfs* when remove()'d while still open()). * Fixed by flagging finalization on last-close if a sillyrename occurs. --- sys/vfs/nfs/nfs_vnops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index aded8c558d..f4b52d34f9 100644 --- a/sys/vfs/nfs/nfs_vnops.c +++ b/sys/vfs/nfs/nfs_vnops.c @@ -2939,6 +2939,11 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) int error; /* + * Force finalization so the VOP_INACTIVE() call is not delayed. + */ + atomic_set_int(&vp->v_refcnt, VREF_FINALIZE); + + /* * We previously purged dvp instead of vp. I don't know why, it * completely destroys performance. We can't do it anyway with the * new VFS API since we would be breaking the namecache topology. -- 2.11.4.GIT