1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-01 17:00:36 +00:00

Do not call bremfree for managed buffers.

Calling bremfree for these buffers results in panic:
"bremfree: buffer %p not on a queue."

Approved by: kib
This commit is contained in:
Grzegorz Bernacki 2012-05-15 09:55:15 +00:00
parent e9a6408e07
commit 823c83e842
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235469

View File

@ -2640,8 +2640,8 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo,
if (bp != NULL) {
int lockflags;
/*
* Buffer is in-core. If the buffer is not busy, it must
* be on a queue.
* Buffer is in-core. If the buffer is not busy nor managed,
* it must be on a queue.
*/
lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK;
@ -2671,9 +2671,13 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo,
bp->b_flags &= ~B_CACHE;
else if ((bp->b_flags & (B_VMIO | B_INVAL)) == 0)
bp->b_flags |= B_CACHE;
BO_LOCK(bo);
bremfree(bp);
BO_UNLOCK(bo);
if (bp->b_flags & B_MANAGED)
MPASS(bp->b_qindex == QUEUE_NONE);
else {
BO_LOCK(bo);
bremfree(bp);
BO_UNLOCK(bo);
}
/*
* check for size inconsistancies for non-VMIO case.