From d119f637fce3136d83eaa268cf1fdd696807f179 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Mon, 9 Jan 2017 17:05:39 +0000 Subject: [PATCH] In mmcsd_task(), bio_resid was not being set to 0 on a successful read or write, resulting in random short-read and short-write returns for requests. Fixing this fixes nominal block I/O via mmcsd(4). Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0) MFC after: 5 days --- sys/dev/mmc/mmcsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 77491234ca8..3132c21aea0 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -545,6 +545,8 @@ mmcsd_task(void *arg) bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_resid = 0; } biodone(bp); }