From a618ef521c8c3fbd8dc50883c0ae5d668649898f Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Fri, 26 Apr 2013 17:28:45 +0000 Subject: [PATCH] Adjust the min comparison to look at the adjust value after subtraction, don't subtract 1 from the chosen value if we are going to use the configued value. Obtained from: Yahoo! Inc. MFC after: 2 weeks --- sys/dev/ciss/ciss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index b190df6d7355..d4c3583a9a68 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -3005,7 +3005,7 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; - cpi->maxio = (min(CISS_MAX_SG_ELEMENTS, sc->ciss_cfg->max_sg_length) - 1) * PAGE_SIZE; + cpi->maxio = (min(CISS_MAX_SG_ELEMENTS - 1, sc->ciss_cfg->max_sg_length)) * PAGE_SIZE; ccb->ccb_h.status = CAM_REQ_CMP; break; }