ocs_fc: When commands complete with an error, freeze the device queue.

Proper error recovery depends on freezing the device queue when an
error occurs, so we can recover from an error before sending
additional commands.

The ocs_fc(4) driver was not freezing the device queue for most
SCSI errors, and that broke error recovery.

sys/dev/ocs_fc/ocs_cam.c:
	In ocs_scsi_initiator_io_cb(), freeze the device queue if
        we're passing back status other than CAM_REQ_CMP.

Submitted by: ken@kdm.org
Reviewed by: mav, ken
This commit is contained in:
Ram Kishore Vegesna 2021-09-24 15:02:09 +05:30
parent 1af49c2eeb
commit d063d1bc92

View File

@ -1523,10 +1523,6 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io,
}
} else if (scsi_status != OCS_SCSI_STATUS_GOOD) {
ccb_status = CAM_REQ_CMP_ERR;
ocs_set_ccb_status(ccb, ccb_status);
csio->ccb_h.status |= CAM_DEV_QFRZN;
xpt_freeze_devq(csio->ccb_h.path, 1);
} else {
ccb_status = CAM_REQ_CMP;
}
@ -1537,8 +1533,15 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io,
csio->ccb_h.ccb_io_ptr = NULL;
csio->ccb_h.ccb_ocs_ptr = NULL;
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
if ((ccb_status != CAM_REQ_CMP) &&
((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0)) {
ccb->ccb_h.status |= CAM_DEV_QFRZN;
xpt_freeze_devq(ccb->ccb_h.path, 1);
}
xpt_done(ccb);
return 0;