summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorgber <gber@FreeBSD.org>2012-05-15 09:55:15 +0000
committergber <gber@FreeBSD.org>2012-05-15 09:55:15 +0000
commit112a2e964fdfb618436588561510319c29938a9b (patch)
tree182e6532c8eae5150be13b1293646d73aa1d2443 /sys/kern/vfs_bio.c
parenteceb1cf926d1a7e09a1764c6ce294ddd67a651f2 (diff)
downloadFreeBSD-src-112a2e964fdfb618436588561510319c29938a9b.zip
FreeBSD-src-112a2e964fdfb618436588561510319c29938a9b.tar.gz
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
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 4eac76d..ba8265a 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2640,8 +2640,8 @@ loop:
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 @@ loop:
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.
OpenPOWER on IntegriCloud