From owner-svn-src-all@FreeBSD.ORG Thu Apr 10 10:12:57 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 6294DDE1; Thu, 10 Apr 2014 10:12:57 +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 4F8F61DC3; Thu, 10 Apr 2014 10:12:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AACvHv067243; Thu, 10 Apr 2014 10:12:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AACvD7067242; Thu, 10 Apr 2014 10:12:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404101012.s3AACvD7067242@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Apr 2014 10:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264313 - head/sys/geom/stripe 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.17 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, 10 Apr 2014 10:12:57 -0000 Author: mav Date: Thu Apr 10 10:12:56 2014 New Revision: 264313 URL: http://svnweb.freebsd.org/changeset/base/264313 Log: Do not increment bio_data in case of BIO_DELETE. This fixes KASSERT() panic in g_io_request(). Modified: head/sys/geom/stripe/g_stripe.c Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Thu Apr 10 07:00:24 2014 (r264312) +++ head/sys/geom/stripe/g_stripe.c Thu Apr 10 10:12:56 2014 (r264313) @@ -472,9 +472,10 @@ g_stripe_start_economic(struct bio *bp, /* offset -= offset % stripesize; */ offset -= offset & (stripesize - 1); - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; length = bp->bio_length - length; - for (no++; length > 0; no++, length -= stripesize, addr += stripesize) { + for (no++; length > 0; no++, length -= stripesize) { if (no > sc->sc_ndisks - 1) { no = 0; offset += stripesize; @@ -506,6 +507,9 @@ g_stripe_start_economic(struct bio *bp, cbp->bio_data = addr; cbp->bio_caller2 = sc->sc_disks[no]; + + if (bp->bio_cmd != BIO_DELETE) + addr += stripesize; } /* * Fire off all allocated requests! @@ -632,10 +636,13 @@ g_stripe_start(struct bio *bp) * a provider, so there is nothing to optmize. * and * 4. Request is not unmapped. + * and + * 5. It is not a BIO_DELETE. */ if (g_stripe_fast && bp->bio_length <= MAXPHYS && bp->bio_length >= stripesize * sc->sc_ndisks && - (bp->bio_flags & BIO_UNMAPPED) == 0) { + (bp->bio_flags & BIO_UNMAPPED) == 0 && + bp->bio_cmd != BIO_DELETE) { fast = 1; } error = 0;