summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_vnops.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-11-17 22:28:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-11-17 22:28:27 +0000
commit49175dac6e732dd877e6aa295f301ab21e422c75 (patch)
treeca403413e0319a7e28418f9a1ec11b25d5cbf1ca /sys/nfs/nfs_vnops.c
parentc37fa0248804cc0df41c6a6d88a8f3c5032728b8 (diff)
buf_acquire() can sleep, so advance down b_vnbufs afterwards
ok beck guenther
Diffstat (limited to 'sys/nfs/nfs_vnops.c')
-rw-r--r--sys/nfs/nfs_vnops.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 4a314a0368e..3b3e6f368f3 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.139 2012/03/23 15:51:26 guenther Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.140 2012/11/17 22:28:26 deraadt Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2796,15 +2796,18 @@ again:
if (NFS_ISV3(vp) && commit) {
s = splbio();
for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp != NULL; bp = nbp) {
- nbp = LIST_NEXT(bp, b_vnbufs);
if (bvecpos >= NFS_COMMITBVECSIZ)
break;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
- != (B_DELWRI | B_NEEDCOMMIT))
+ != (B_DELWRI | B_NEEDCOMMIT)) {
+ nbp = LIST_NEXT(bp, b_vnbufs);
continue;
+ }
bremfree(bp);
bp->b_flags |= B_WRITEINPROG;
buf_acquire(bp);
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
/*
* A list of these buffers is kept so that the
* second loop knows which buffers have actually