From owner-svn-src-projects@FreeBSD.ORG Sat Oct 12 10:26:41 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0D6EF47F; Sat, 12 Oct 2013 10:26:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFDC225DF; Sat, 12 Oct 2013 10:26:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CAQepZ029728; Sat, 12 Oct 2013 10:26:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CAQehP029727; Sat, 12 Oct 2013 10:26:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310121026.r9CAQehP029727@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Oct 2013 10:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256371 - projects/camlock/sys/geom X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 10:26:41 -0000 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);