From 7445f79ec2116bd87b6972c03986e41535d73509 Mon Sep 17 00:00:00 2001 From: rwatson Date: Sat, 9 Feb 2008 00:12:22 +0000 Subject: [PATCH] Lock cache vnode when VOP_FSYNC() is called on a Coda vnode. MFC after: 1 month --- sys/fs/coda/coda_vnops.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index ed5d75b1ac1b..adfe09eb308d 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