summaryrefslogtreecommitdiffstats
path: root/sys/nwfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nwfs')
-rw-r--r--sys/nwfs/nwfs_vnops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/nwfs/nwfs_vnops.c b/sys/nwfs/nwfs_vnops.c
index d084503..38e9f19 100644
--- a/sys/nwfs/nwfs_vnops.c
+++ b/sys/nwfs/nwfs_vnops.c
@@ -262,10 +262,16 @@ nwfs_close(ap)
simple_unlock(&vp->v_interlock);
return 0;
}
+ simple_unlock(&vp->v_interlock);
error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 1);
- if (--np->opened == 0) {
- error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, ap->a_p,ap->a_cred);
+ simple_lock(&vp->v_interlock);
+ if (np->opened == 0) {
+ simple_unlock(&vp->v_interlock);
+ return 0;
}
+ if (--np->opened == 0)
+ error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh,
+ ap->a_p, ap->a_cred);
simple_unlock(&vp->v_interlock);
np->n_atime = 0;
return (error);
OpenPOWER on IntegriCloud