diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 9f8fc2f4c91c..a6ba1c01022a 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -309,6 +309,8 @@ BUF_UNLOCK(struct buf *bp) int s; s = splbio(); + KASSERT((bp->b_flags & B_REMFREE) == 0, + ("BUF_UNLOCK %p while B_REMFREE is still set.", bp)); lockmgr(&(bp)->b_lock, LK_RELEASE, NULL, curthread); splx(s); }