From owner-svn-src-head@FreeBSD.ORG Tue Dec 10 21:15:18 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTPS id A0AC771B; Tue, 10 Dec 2013 21:15:18 +0000 (UTC) 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 8D1CC1138; Tue, 10 Dec 2013 21:15:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBALFIY6024384; Tue, 10 Dec 2013 21:15:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBALFIDx024383; Tue, 10 Dec 2013 21:15:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312102115.rBALFIDx024383@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Dec 2013 21:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259200 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 21:15:18 -0000 Author: kib Date: Tue Dec 10 21:15:18 2013 New Revision: 259200 URL: http://svnweb.freebsd.org/changeset/base/259200 Log: Fix detection of EOF in kern_physio(). If bio_length was clipped by the excess code in g_io_check(), bio_resid is also truncated by g_io_deliver(). As result, bufdonebio() assigns truncated value to the buffer b_resid field. Use the residual bio_completed to calculate buffer b_resid from b_bcount in bufdonebio(), instead of bio_resid, calculated from bio_length in g_io_deliver(). The issue is seemingly caused by the code rearrange into g_io_check(), which is not present in stable/10. The change still looks as the useful change to have in 10 nevertheless. Reported by: Stefan Hegnauer Tested by: pho, Stefan Hegnauer Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Dec 10 21:01:28 2013 (r259199) +++ head/sys/kern/vfs_bio.c Tue Dec 10 21:15:18 2013 (r259200) @@ -3679,7 +3679,6 @@ bufdonebio(struct bio *bip) bp = bip->bio_caller2; bp->b_resid = bp->b_bcount - bip->bio_completed; - bp->b_resid = bip->bio_resid; /* XXX: remove */ bp->b_ioflags = bip->bio_flags; bp->b_error = bip->bio_error; if (bp->b_error)