diff options
author | markj <markj@FreeBSD.org> | 2015-09-15 05:09:17 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2015-09-15 05:09:17 +0000 |
commit | 67708eb40cd176c007ac02528edd89fbaa8c8111 (patch) | |
tree | c5175375cc3c5eaeeb2cfe9d30b0a04848b5fca2 /sys/cam | |
parent | a0800810ee083fc3abe46906b4ca366ce617d871 (diff) | |
download | FreeBSD-src-67708eb40cd176c007ac02528edd89fbaa8c8111.zip FreeBSD-src-67708eb40cd176c007ac02528edd89fbaa8c8111.tar.gz |
Preserve the device queue status before retrying a sense request in
chdone(). Previously, the retry could clear the CAM_DEV_QFRZN bit in the
CCB status, leaving the queue frozen.
Submitted by: Jeff Miller <Jeff.Miller@isilon.com>
Reviewed by: ken
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_ch.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index 38acb01..bc398e7 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -655,11 +655,13 @@ chdone(struct cam_periph *periph, union ccb *done_ccb) */ return; } else if (error != 0) { - int retry_scheduled; struct scsi_mode_sense_6 *sms; + int frozen, retry_scheduled; sms = (struct scsi_mode_sense_6 *) done_ccb->csio.cdb_io.cdb_bytes; + frozen = (done_ccb->ccb_h.status & + CAM_DEV_QFRZN) != 0; /* * Check to see if block descriptors were @@ -670,7 +672,8 @@ chdone(struct cam_periph *periph, union ccb *done_ccb) * block descriptors were disabled, enable * them and re-send the command. */ - if (sms->byte2 & SMS_DBD) { + if ((sms->byte2 & SMS_DBD) != 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { sms->byte2 &= ~SMS_DBD; xpt_action(done_ccb); softc->quirks |= CH_Q_NO_DBD; @@ -679,7 +682,7 @@ chdone(struct cam_periph *periph, union ccb *done_ccb) retry_scheduled = 0; /* Don't wedge this device's queue */ - if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + if (frozen) cam_release_devq(done_ccb->ccb_h.path, /*relsim_flags*/0, /*reduction*/0, |