Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Dec 2020 22:01:55 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 795a009b325c - main - md: Set bio_completed properly in the face of errors
Message-ID:  <202012272201.0BRM1tSH043394@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=795a009b325c93a0f48a83a68b5278160ac6d38e

commit 795a009b325c93a0f48a83a68b5278160ac6d38e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2020-12-27 21:49:35 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
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);
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012272201.0BRM1tSH043394>