summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1995-12-12 04:18:10 +0000
committerdyson <dyson@FreeBSD.org>1995-12-12 04:18:10 +0000
commitf7305800eb9720f51e49e4160895c902234dde86 (patch)
treed170ffc8dae9f8dd4ce27a14f1c8105e4c23422b
parentc4908135ec2f4b5cbe7350045a6a125222097c42 (diff)
downloadFreeBSD-src-f7305800eb9720f51e49e4160895c902234dde86.zip
FreeBSD-src-f7305800eb9720f51e49e4160895c902234dde86.tar.gz
This should have fixed some conditions that could cause the
"getblk" hang. The B_WANTED flag was being cleared gratuitously, also the optimization of gbincore for ignoring the B_INVAL flag was incorrect. There is no place in the code where buffers are on the hash list that are B_INVAL and not B_BUSY.
-rw-r--r--sys/kern/vfs_bio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 3b2c838..b6d0d5e 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: vfs_bio.c,v 1.75 1995/12/07 12:47:02 davidg Exp $
+ * $Id: vfs_bio.c,v 1.76 1995/12/11 04:56:05 dyson Exp $
*/
/*
@@ -570,7 +570,8 @@ gbincore(struct vnode * vp, daddr_t blkno)
/* Search hash chain */
while (bp != NULL) {
/* hit */
- if (bp->b_vp == vp && bp->b_lblkno == blkno) {
+ if (bp->b_vp == vp && bp->b_lblkno == blkno &&
+ (bp->b_flags & B_INVAL) == 0) {
break;
}
bp = bp->b_hash.le_next;
@@ -887,7 +888,7 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo)
s = splbio();
loop:
if ((bp = gbincore(vp, blkno))) {
- if (bp->b_flags & (B_BUSY|B_INVAL)) {
+ if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
if (bp->b_usecount < BUF_MAXUSE)
++bp->b_usecount;
@@ -1376,7 +1377,6 @@ biodone(register struct buf * bp)
if (bp->b_flags & B_ASYNC) {
brelse(bp);
} else {
- bp->b_flags &= ~B_WANTED;
wakeup(bp);
}
splx(s);
OpenPOWER on IntegriCloud