From owner-dev-commits-src-main@freebsd.org Sun Dec 27 22:01:55 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAE144C8B51; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3vm34VQDz3mmK; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DD0666D4; Sun, 27 Dec 2020 22:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRM1t8q043395; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRM1tSH043394; Sun, 27 Dec 2020 22:01:55 GMT (envelope-from git) Date: Sun, 27 Dec 2020 22:01:55 GMT Message-Id: <202012272201.0BRM1tSH043394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 795a009b325c - main - md: Set bio_completed properly in the face of errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 795a009b325c93a0f48a83a68b5278160ac6d38e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 22:01:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=795a009b325c93a0f48a83a68b5278160ac6d38e commit 795a009b325c93a0f48a83a68b5278160ac6d38e Author: Mark Johnston AuthorDate: 2020-12-27 21:49:35 +0000 Commit: Mark Johnston CommitDate: 2020-12-27 21:49:35 +0000 md: Set bio_completed properly in the face of errors Account for any residual bytes. This is only relevant for vnode-backed md(4) devices. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27738 --- sys/dev/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 1778eda48f35..1b4b583b3c09 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1244,7 +1244,7 @@ md_kthread(void *arg) bp->bio_bcount = bp->bio_length; devstat_end_transaction_bio(sc->devstat, bp); } - bp->bio_completed = bp->bio_length; + bp->bio_completed = bp->bio_length - bp->bio_resid; g_io_deliver(bp, error); } }