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
This commit is contained in:
Mark Johnston 2020-12-27 16:49:35 -05:00
parent e458944cf9
commit 795a009b32

View File

@ -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);
}
}