Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2014 12:50:31 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r265676 - stable/9/sys/geom/stripe
Message-ID:  <201405081250.s48CoVQ1099841@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu May  8 12:50:31 2014
New Revision: 265676
URL: http://svnweb.freebsd.org/changeset/base/265676

Log:
  MFC r264313:
  Do not increment bio_data in case of BIO_DELETE.
  
  This fixes KASSERT() panic in g_io_request().

Modified:
  stable/9/sys/geom/stripe/g_stripe.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/stripe/g_stripe.c
==============================================================================
--- stable/9/sys/geom/stripe/g_stripe.c	Thu May  8 12:39:07 2014	(r265675)
+++ stable/9/sys/geom/stripe/g_stripe.c	Thu May  8 12:50:31 2014	(r265676)
@@ -462,9 +462,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;
@@ -489,6 +490,9 @@ g_stripe_start_economic(struct bio *bp, 
 		cbp->bio_length = MIN(stripesize, length);
 
 		cbp->bio_caller2 = sc->sc_disks[no];
+
+		if (bp->bio_cmd != BIO_DELETE)
+			addr += stripesize;
 	}
 	/*
 	 * Fire off all allocated requests!
@@ -613,9 +617,12 @@ g_stripe_start(struct bio *bp)
 	 * 3. Request size is bigger than stripesize * ndisks. If it isn't,
 	 *    there will be no need to send more than one I/O request to
 	 *    a provider, so there is nothing to optmize.
+	 * 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_length >= stripesize * sc->sc_ndisks &&
+	    bp->bio_cmd != BIO_DELETE) {
 		fast = 1;
 	}
 	error = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405081250.s48CoVQ1099841>