summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_bio.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-05-15 21:12:08 +0000
committerrwatson <rwatson@FreeBSD.org>2003-05-15 21:12:08 +0000
commit94ff93f449f6846c6c61435659387b97cfd4aa8c (patch)
tree4a74e55c92f8d4993ed69006e456d2e6870c355c /sys/nfsclient/nfs_bio.c
parent7e2cfac5e09cab2e6a3c4e05c476c2326bb4ba09 (diff)
downloadFreeBSD-src-94ff93f449f6846c6c61435659387b97cfd4aa8c.zip
FreeBSD-src-94ff93f449f6846c6c61435659387b97cfd4aa8c.tar.gz
This change grabs the vnode lock for NFS client vnodes when calling
VOP_SETATTR() or VOP_GETATTR(); without these locks (a) VFS_DEBUG_LOCKS will panic, and (b) it may be possible to corrupt entries in the cached vnode attributes in the nfsnode, since nfsnode attribute cache data is also protected by the vnode lock. Approved by: re (jhb) Pointed out by: VFS_DEBUG_LOCKS
Diffstat (limited to 'sys/nfsclient/nfs_bio.c')
-rw-r--r--sys/nfsclient/nfs_bio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 379419e..088be65 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -1063,6 +1063,8 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred,
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
int error = 0, slpflag, slptimeo;
+ ASSERT_VOP_LOCKED(vp, "nfs_vinvalbuf");
+
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
/* XXX Should we wait here? */
@@ -1344,7 +1346,7 @@ nfs_doio(struct buf *bp, struct ucred *cr, struct thread *td)
uiop->uio_resid = 0;
}
}
- ASSERT_VOP_LOCKED(vp, "nfs_doio");
+ /* ASSERT_VOP_LOCKED(vp, "nfs_doio"); */
if (p && (vp->v_vflag & VV_TEXT) &&
(np->n_mtime != np->n_vattr.va_mtime.tv_sec)) {
uprintf("Process killed due to text file modification\n");
OpenPOWER on IntegriCloud