diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2012-06-17 18:34:04 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2012-06-17 18:34:04 +0000 |
commit | 77d92cc9de1dc6c64aa709bb77a4cf4e3febea75 (patch) | |
tree | 6ffb6cbd0ad7ec33d553647ffb24388458269647 /sys/fs/nfsclient/nfs_clnode.c | |
parent | 32ff81e94ffc0093230891906286153e73046786 (diff) | |
download | FreeBSD-src-77d92cc9de1dc6c64aa709bb77a4cf4e3febea75.zip FreeBSD-src-77d92cc9de1dc6c64aa709bb77a4cf4e3febea75.tar.gz |
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.
Suggested by: kib
MFC after: 1 week
Diffstat (limited to 'sys/fs/nfsclient/nfs_clnode.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clnode.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index db3a350..087858d 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -257,15 +257,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. @@ -278,6 +269,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); /* |