summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorgluk <gluk@openbsd.org>2001-05-28 00:23:02 +0000
committergluk <gluk@openbsd.org>2001-05-28 00:23:02 +0000
commitc4b5909bbca9b1333a9e8f3cf4024949d178ba15 (patch)
treed4b84a82f5dedd933de41bef5d87dd85f88a3c23 /sys/kern/vfs_cluster.c
parentFix "(seeUVM(9))" (diff)
downloadwireguard-openbsd-c4b5909bbca9b1333a9e8f3cf4024949d178ba15.tar.xz
wireguard-openbsd-c4b5909bbca9b1333a9e8f3cf4024949d178ba15.zip
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;
}