From owner-svn-src-all@FreeBSD.ORG Thu Sep 4 00:10:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C71FA344; Thu, 4 Sep 2014 00:10:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B324E1CA8; Thu, 4 Sep 2014 00:10:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s840A6Hm052682; Thu, 4 Sep 2014 00:10:06 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s840A6Jf052681; Thu, 4 Sep 2014 00:10:06 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201409040010.s840A6Jf052681@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 4 Sep 2014 00:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271070 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 00:10:06 -0000 Author: benno Date: Thu Sep 4 00:10:06 2014 New Revision: 271070 URL: http://svnweb.freebsd.org/changeset/base/271070 Log: Add KASSERTs to catch the case where a developer may have forgotten to set bo_bsize on a bufobj. This is a slight modification of the patch provided. PR: 193146 Submitted by: Conrad Meyer Sponsored by: EMC Isilon Storage Division Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Sep 3 23:29:06 2014 (r271069) +++ head/sys/kern/vfs_bio.c Thu Sep 4 00:10:06 2014 (r271070) @@ -2971,6 +2971,7 @@ bp_unmapped_get_kva(struct buf *bp, dadd * if the buffer was mapped. */ bsize = vn_isdisk(bp->b_vp, NULL) ? DEV_BSIZE : bp->b_bufobj->bo_bsize; + KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); offset = blkno * bsize; maxsize = size + (offset & PAGE_MASK); maxsize = imax(maxsize, bsize); @@ -3220,6 +3221,7 @@ loop: return NULL; bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; + KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); offset = blkno * bsize; vmio = vp->v_object != NULL; if (vmio) {