From 157cb465c4bb76bb2b773495c3fa896f3db942de Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 14 Mar 2018 16:44:57 +0000 Subject: [PATCH] Fix inverted logic that counted all completions as errors, except when they were actual errors. Sponsored by: Netflix --- sys/cam/cam_iosched.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c index 11ab1e21e07..b36f5f943ca 100644 --- a/sys/cam/cam_iosched.c +++ b/sys/cam/cam_iosched.c @@ -1473,18 +1473,18 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc, struct bio *bp, printf("done: %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_WRITE) { retval = cam_iosched_limiter_iodone(&isc->write_stats, bp); - if (!(bp->bio_flags & BIO_ERROR)) + if ((bp->bio_flags & BIO_ERROR) != 0) isc->write_stats.errs++; isc->write_stats.out++; isc->write_stats.pending--; } else if (bp->bio_cmd == BIO_READ) { retval = cam_iosched_limiter_iodone(&isc->read_stats, bp); - if (!(bp->bio_flags & BIO_ERROR)) + if ((bp->bio_flags & BIO_ERROR) != 0) isc->read_stats.errs++; isc->read_stats.out++; isc->read_stats.pending--; } else if (bp->bio_cmd == BIO_DELETE) { - if (!(bp->bio_flags & BIO_ERROR)) + if ((bp->bio_flags & BIO_ERROR) != 0) isc->trim_stats.errs++; isc->trim_stats.out++; isc->trim_stats.pending--;