[Midnightbsd-cvs] src [8243] trunk/sys/cam/scsi/scsi_cd.c: there are SCSI conditions that are not errors.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Sep 17 17:32:34 EDT 2016


Revision: 8243
          http://svnweb.midnightbsd.org/src/?rev=8243
Author:   laffer1
Date:     2016-09-17 17:32:34 -0400 (Sat, 17 Sep 2016)
Log Message:
-----------
there are SCSI conditions that are not errors.

Modified Paths:
--------------
    trunk/sys/cam/scsi/scsi_cd.c

Modified: trunk/sys/cam/scsi/scsi_cd.c
===================================================================
--- trunk/sys/cam/scsi/scsi_cd.c	2016-09-17 21:32:10 UTC (rev 8242)
+++ trunk/sys/cam/scsi/scsi_cd.c	2016-09-17 21:32:34 UTC (rev 8243)
@@ -1661,6 +1661,7 @@
 					       * bytes.
 					       */
 		struct	   cd_params *cdp;
+		int error;
 
 		cdp = &softc->params;
 
@@ -1669,7 +1670,13 @@
 		cdp->disksize = scsi_4btoul (rdcap->addr) + 1;
 		cdp->blksize = scsi_4btoul (rdcap->length);
 
-		if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		/*
+		 * Retry any UNIT ATTENTION type errors.  They
+		 * are expected at boot.
+		 */
+		if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP ||
+		    (error = cderror(done_ccb, CAM_RETRY_SELTO,
+				SF_RETRY_UA | SF_NO_PRINT)) == 0) {
 
 			snprintf(announce_buf, sizeof(announce_buf),
 				"cd present [%lu x %lu byte records]",
@@ -1676,13 +1683,6 @@
 				cdp->disksize, (u_long)cdp->blksize);
 
 		} else {
-			int	error;
-			/*
-			 * Retry any UNIT ATTENTION type errors.  They
-			 * are expected at boot.
-			 */
-			error = cderror(done_ccb, CAM_RETRY_SELTO,
-					SF_RETRY_UA | SF_NO_PRINT);
 			if (error == ERESTART) {
 				/*
 				 * A retry was scheuled, so
@@ -1689,8 +1689,7 @@
 				 * just return.
 				 */
 				return;
-			} else if (error != 0) {
-
+			} else {
 				struct scsi_sense_data *sense;
 				int asc, ascq;
 				int sense_key, error_code;



More information about the Midnightbsd-cvs mailing list