From c7e01cfb97a1b4eaf8aa629e976dbf14bb061cb4 Mon Sep 17 00:00:00 2001 From: rmacklem Date: Fri, 7 Sep 2012 13:17:18 +0000 Subject: [PATCH] MFC: r237200 Move the nfsrpc_close() call in ncl_reclaim() for the NFSv4 client to below the vnode_destroy_vobject() call, since that is where writes are flushed. git-svn-id: svn://svn.freebsd.org/base/stable/8@240197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/fs/nfsclient/nfs_clnode.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index a5515f615..a3085b009 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -254,15 +254,6 @@ ncl_reclaim(struct vop_reclaim_args *ap) struct nfsnode *np = VTONFS(vp); struct nfsdmap *dp, *dp2; - if (NFS_ISV4(vp) && vp->v_type == VREG) - /* - * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4 - * Close operations are delayed until ncl_inactive(). - * However, since VOP_INACTIVE() is not guaranteed to be - * called, we need to do it again here. - */ - (void) nfsrpc_close(vp, 1, ap->a_td); - /* * If the NLM is running, give it a chance to abort pending * locks. @@ -275,6 +266,15 @@ ncl_reclaim(struct vop_reclaim_args *ap) */ vnode_destroy_vobject(vp); + if (NFS_ISV4(vp) && vp->v_type == VREG) + /* + * We can now safely close any remaining NFSv4 Opens for + * this file. Most opens will have already been closed by + * ncl_inactive(), but there are cases where it is not + * called, so we need to do it again here. + */ + (void) nfsrpc_close(vp, 1, ap->a_td); + vfs_hash_remove(vp); /* -- 2.45.0