svn commit: r265674 - stable/9/sys/geom

Alexander Motin mav at FreeBSD.org
Thu May 8 12:35:38 UTC 2014


Author: mav
Date: Thu May  8 12:35:37 2014
New Revision: 265674
URL: http://svnweb.freebsd.org/changeset/base/265674

Log:
  MFC r256607, r259247:
  Fix passing uninitialized bio_resid argument to g_trace().

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

Modified: stable/9/sys/geom/geom_dev.c
==============================================================================
--- stable/9/sys/geom/geom_dev.c	Thu May  8 12:28:24 2014	(r265673)
+++ stable/9/sys/geom/geom_dev.c	Thu May  8 12:35:37 2014	(r265674)
@@ -489,16 +489,16 @@ g_dev_done(struct bio *bp2)
 	sc = cp->private;
 	bp = bp2->bio_parent;
 	bp->bio_error = bp2->bio_error;
-	if (bp->bio_error != 0) {
+	bp->bio_completed = bp2->bio_completed;
+	bp->bio_resid = bp->bio_length - bp2->bio_completed;
+	if (bp2->bio_error != 0) {
 		g_trace(G_T_BIO, "g_dev_done(%p) had error %d",
-		    bp2, bp->bio_error);
+		    bp2, bp2->bio_error);
 		bp->bio_flags |= BIO_ERROR;
 	} else {
 		g_trace(G_T_BIO, "g_dev_done(%p/%p) resid %ld completed %jd",
-		    bp2, bp, bp->bio_resid, (intmax_t)bp2->bio_completed);
+		    bp2, bp, bp2->bio_resid, (intmax_t)bp2->bio_completed);
 	}
-	bp->bio_resid = bp->bio_length - bp2->bio_completed;
-	bp->bio_completed = bp2->bio_completed;
 	g_destroy_bio(bp2);
 	destroy = 0;
 	mtx_lock(&sc->sc_mtx);


More information about the svn-src-stable-9 mailing list