summaryrefslogtreecommitdiffstats
path: root/sys/fs/coda
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-02-09 00:12:22 +0000
committerrwatson <rwatson@FreeBSD.org>2008-02-09 00:12:22 +0000
commit7445f79ec2116bd87b6972c03986e41535d73509 (patch)
treef370a0c0f68a77ce12ea159e572775788d9f791c /sys/fs/coda
parent0a37acb8a6ab30c3fb8744bc3c243b6393d152d8 (diff)
downloadFreeBSD-src-7445f79ec2116bd87b6972c03986e41535d73509.zip
FreeBSD-src-7445f79ec2116bd87b6972c03986e41535d73509.tar.gz
Lock cache vnode when VOP_FSYNC() is called on a Coda vnode.
MFC after: 1 month
Diffstat (limited to 'sys/fs/coda')
-rw-r--r--sys/fs/coda/coda_vnops.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index ed5d75b..adfe09e 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -699,8 +699,11 @@ coda_fsync(struct vop_fsync_args *ap)
return(0);
}
- if (convp)
+ if (convp) {
+ vn_lock(convp, LK_EXCLUSIVE | LK_RETRY);
VOP_FSYNC(convp, MNT_WAIT, td);
+ VOP_UNLOCK(convp, 0);
+ }
/*
* We see fsyncs with usecount == 1 then usecount == 0.
@@ -716,7 +719,7 @@ coda_fsync(struct vop_fsync_args *ap)
*/
/*
- * We can expect fsync on any vnode at all if venus is pruging it.
+ * We can expect fsync on any vnode at all if venus is purging it.
* Venus can't very well answer the fsync request, now can it?
* Hopefully, it won't have to, because hopefully, venus preserves
* the (possibly untrue) invariant that it never purges an open
OpenPOWER on IntegriCloud