aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-08-02 16:34:27 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-08-02 16:34:27 +0000
commit9da903e5d3fa686b67df0c8d460fcf3ca9444172 (patch)
tree3f14aeb6225fab9bc5a32bbb79b83cc4fab92bd0
parent936c24fabaf5f532b16489d03e88350c3cee4cc7 (diff)
Notes
-rw-r--r--sys/kern/vfs_bio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 524554cdd48f..adc44082d972 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1637,7 +1637,7 @@ static struct buf *
buf_alloc(struct bufdomain *bd)
{
struct buf *bp;
- int freebufs;
+ int freebufs, error;
/*
* We can only run out of bufs in the buf zone if the average buf
@@ -1660,8 +1660,10 @@ buf_alloc(struct bufdomain *bd)
if (freebufs == bd->bd_lofreebuffers)
bufspace_daemon_wakeup(bd);
- if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0)
- panic("getnewbuf_empty: Locked buf %p on free queue.", bp);
+ error = BUF_LOCK(bp, LK_EXCLUSIVE, NULL);
+ KASSERT(error == 0, ("%s: BUF_LOCK on free buf %p: %d.", __func__, bp,
+ error));
+ (void)error;
KASSERT(bp->b_vp == NULL,
("bp: %p still has vnode %p.", bp, bp->b_vp));