From owner-svn-src-head@FreeBSD.ORG Tue May 15 09:55:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01FD106564A; Tue, 15 May 2012 09:55:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB4B28FC1A; Tue, 15 May 2012 09:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4F9tFvb079474; Tue, 15 May 2012 09:55:15 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4F9tFTo079472; Tue, 15 May 2012 09:55:15 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205150955.q4F9tFTo079472@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 15 May 2012 09:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235469 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 09:55:15 -0000 Author: gber Date: Tue May 15 09:55:15 2012 New Revision: 235469 URL: http://svn.freebsd.org/changeset/base/235469 Log: 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 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue May 15 09:37:22 2012 (r235468) +++ head/sys/kern/vfs_bio.c Tue May 15 09:55:15 2012 (r235469) @@ -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.