Skip to contentSkip to conversation

sd: spurious error messages in READ_CAPACITY(16)

PATCH In review Hannes Reinecke 2 participants 2 messages Mar 29, 2010 – Mar 30, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sd: spurious error messages in READ_CAPACITY(16)

sd always tries to submit a READ_CAPACITY(16) CDB, regardless whether the host actually supports it. queuecommand() will then return DID_ABORT, which is not qualified enough to detect the true cause here. So better check in sd_try_rc16 first if the cdblen is supported.

drivers/scsi/sd.c +2 -0
index 9c8f4b5..1962bea 100644
@@ -1484,6 +1484,8 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,
 
 static int sd_try_rc16_first(struct scsi_device *sdp)
 {
+	if (sdp->host->max_cmd_len < 16)
+		return 0;
 	if (sdp->scsi_level > SCSI_SPC_2)
 		return 1;
 	if (scsi_device_protection(sdp))
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Hannes" == Hannes Reinecke <[email protected]> writes:

Hannes> sd always tries to submit a READ_CAPACITY(16) CDB, regardless Hannes> whether the host actually supports it. queuecommand() will then Hannes> return DID_ABORT, which is not qualified enough to detect the Hannes> true cause here. So better check in sd_try_rc16 first if the Hannes> cdblen is supported.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering