From owner-svn-src-stable@FreeBSD.ORG Tue Jun 18 09:29:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9AD3DA58; Tue, 18 Jun 2013 09:29:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D7AB1AAD; Tue, 18 Jun 2013 09:29:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5I9TUXs084416; Tue, 18 Jun 2013 09:29:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9TUkJ084415; Tue, 18 Jun 2013 09:29:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180929.r5I9TUkJ084415@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251920 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:29:30 -0000 Author: mav Date: Tue Jun 18 09:29:30 2013 New Revision: 251920 URL: http://svnweb.freebsd.org/changeset/base/251920 Log: MFC r248596 (by kib): Correct the page count when excess length is trimmed from the bio. Modified: stable/9/sys/geom/geom_io.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_io.c ============================================================================== --- stable/9/sys/geom/geom_io.c Tue Jun 18 09:28:49 2013 (r251919) +++ stable/9/sys/geom/geom_io.c Tue Jun 18 09:29:30 2013 (r251920) @@ -718,8 +718,17 @@ g_io_schedule_down(struct thread *tp __u */ excess = bp->bio_offset + bp->bio_length; if (excess > bp->bio_to->mediasize) { + KASSERT((bp->bio_flags & BIO_UNMAPPED) == 0 || + round_page(bp->bio_ma_offset + + bp->bio_length) / PAGE_SIZE == bp->bio_ma_n, + ("excess bio %p too short", bp)); excess -= bp->bio_to->mediasize; bp->bio_length -= excess; + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + bp->bio_ma_n = round_page( + bp->bio_ma_offset + + bp->bio_length) / PAGE_SIZE; + } if (excess > 0) CTR3(KTR_GEOM, "g_down truncated bio " "%p provider %s by %d", bp,