On BIO_ERROR, set bio_resid to stop losing data in the error case.

Submitted by:	Mark Johnston <markjdb@gmail.com>
Reviewed by:	scottl@freebsd.org
MFC after:	2 weeks
This commit is contained in:
Sean Bruno 2012-07-18 18:10:27 +00:00
parent 0c19b5de29
commit ce61627a2d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238601

View File

@ -334,8 +334,10 @@ aac_biodone(struct bio *bp)
{
fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
if (bp->bio_flags & BIO_ERROR)
if (bp->bio_flags & BIO_ERROR) {
bp->bio_resid = bp->bio_bcount;
disk_err(bp, "hard error", -1, 1);
}
biodone(bp);
}