summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-03-13 07:04:11 +0000
committerjeff <jeff@FreeBSD.org>2003-03-13 07:04:11 +0000
commit4b8b33db8ab3d11223c1226ea62c38a4549967b1 (patch)
tree5c8950e330aa692f14fbaf472ca9949158bf99b2 /sys/nfsclient
parentdc2fc01c024e4580e7f2bca3873518c3c480d23c (diff)
downloadFreeBSD-src-4b8b33db8ab3d11223c1226ea62c38a4549967b1.zip
FreeBSD-src-4b8b33db8ab3d11223c1226ea62c38a4549967b1.tar.gz
- Lock the buf before inspecting its contents.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vnops.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 2a137b7..253f0c7 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -2658,18 +2658,16 @@ again:
for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
if (bvecpos >= bvecsize)
break;
- if ((bp->b_flags & (B_DELWRI | B_NEEDCOMMIT)) !=
- (B_DELWRI | B_NEEDCOMMIT)) {
+ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) {
nbp = TAILQ_NEXT(bp, b_vnbufs);
continue;
}
- if (BUF_LOCK(bp,
- LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK,
- VI_MTX(vp))) {
- VI_LOCK(vp);
+ if ((bp->b_flags & (B_DELWRI | B_NEEDCOMMIT)) !=
+ (B_DELWRI | B_NEEDCOMMIT)) {
nbp = TAILQ_NEXT(bp, b_vnbufs);
continue;
}
+ VI_UNLOCK(vp);
bremfree(bp);
/*
* Work out if all buffers are using the same cred
OpenPOWER on IntegriCloud