svn commit: r256371 - projects/camlock/sys/geom
Alexander Motin
mav at FreeBSD.org
Sat Oct 12 10:26:41 UTC 2013
Author: mav
Date: Sat Oct 12 10:26:40 2013
New Revision: 256371
URL: http://svnweb.freebsd.org/changeset/base/256371
Log:
Fix passing uninitialized bio_resid argument to g_trace().
Curious that I've found it during profiling by unexpected cache miss. :)
Modified:
projects/camlock/sys/geom/geom_dev.c
Modified: projects/camlock/sys/geom/geom_dev.c
==============================================================================
--- projects/camlock/sys/geom/geom_dev.c Sat Oct 12 09:56:09 2013 (r256370)
+++ projects/camlock/sys/geom/geom_dev.c Sat Oct 12 10:26:40 2013 (r256371)
@@ -486,16 +486,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);
More information about the svn-src-projects
mailing list