Author: mav
Date: Wed Oct 16 09:21:40 2013
New Revision: 256607
URL: http://svnweb.freebsd.org/changeset/base/256607

Log:
  MFprojects/camlock r256371:
  Fix passing uninitialized bio_resid argument to g_trace().

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c    Wed Oct 16 09:18:01 2013        (r256606)
+++ head/sys/geom/geom_dev.c    Wed Oct 16 09:21:40 2013        (r256607)
@@ -485,16 +485,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 = bp2->bio_resid;
+       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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to