Lock cache vnode when VOP_FSYNC() is called on a Coda vnode.

MFC after:	1 month
This commit is contained in:
rwatson 2008-02-09 00:12:22 +00:00
parent 0a37acb8a6
commit 7445f79ec2

View File

@ -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