summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorGrigoriy Orlov <gluk@cvs.openbsd.org>2001-05-28 00:23:03 +0000
committerGrigoriy Orlov <gluk@cvs.openbsd.org>2001-05-28 00:23:03 +0000
commit7c60975414004eb106f109d4e52180e1828ae521 (patch)
tree15268a783bda2d333a72d48729adfe896be1f142 /sys/kern/vfs_cluster.c
parentfbec50fd4662d7571c1f164220dd104080aa14eb (diff)
cluster_rbuild() have a race between incore and getblk. incore() returns
zero indicating that buffer is not in a cache, but getblk() going to sleep: getblk->getnewbuf->tsleep. When getnewbuf() returns after a sleep, getblk() may find B_DONE buffer in hash and return it. When io operation finishes biodone() calls cluster_callback() which moves pages from one big cluster buffer into several component buffers and calls biodone() for every component buffer. Since there are a component buffer with B_DONE already set, biodone() panices: "biodone already". costa@ ok.
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index a0dbb42b9a7..bd1d70d8b05 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_cluster.c,v 1.23 2001/05/20 22:18:10 gluk Exp $ */
+/* $OpenBSD: vfs_cluster.c,v 1.24 2001/05/28 00:23:02 gluk Exp $ */
/* $NetBSD: vfs_cluster.c,v 1.12 1996/04/22 01:39:05 christos Exp $ */
/*-
@@ -353,6 +353,7 @@ cluster_rbuild(vp, filesize, bp, lbn, blkno, size, run, flags)
pagemove(bdata, bdata + tbp->b_bufsize, size);
}
tbp->b_blkno = bn;
+ tbp->b_flags &= ~(B_DONE | B_ERROR);
tbp->b_flags |= flags | B_READ | B_ASYNC;
b_save->bs_children[b_save->bs_nchildren++] = tbp;
}