Assert that runningbufspace does not underflow.
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
da4ca6c8ab
commit
982d771242
@ -474,10 +474,12 @@ runningbufwakeup(struct buf *bp)
|
||||
{
|
||||
long space, bspace;
|
||||
|
||||
if (bp->b_runningbufspace == 0)
|
||||
return;
|
||||
space = atomic_fetchadd_long(&runningbufspace, -bp->b_runningbufspace);
|
||||
bspace = bp->b_runningbufspace;
|
||||
if (bspace == 0)
|
||||
return;
|
||||
space = atomic_fetchadd_long(&runningbufspace, -bspace);
|
||||
KASSERT(space >= bspace, ("runningbufspace underflow %ld %ld",
|
||||
space, bspace));
|
||||
bp->b_runningbufspace = 0;
|
||||
/*
|
||||
* Only acquire the lock and wakeup on the transition from exceeding
|
||||
|
Loading…
x
Reference in New Issue
Block a user