public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sd: spurious error messages in READ_CAPACITY(16)
@ 2010-03-29  7:29 Hannes Reinecke
  2010-03-30 17:21 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2010-03-29  7:29 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi


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.

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9c8f4b5..1962bea 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -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))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sd: spurious error messages in READ_CAPACITY(16)
  2010-03-29  7:29 [PATCH] sd: spurious error messages in READ_CAPACITY(16) Hannes Reinecke
@ 2010-03-30 17:21 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2010-03-30 17:21 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: James Bottomley, linux-scsi

>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> 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.

Acked-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-30 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29  7:29 [PATCH] sd: spurious error messages in READ_CAPACITY(16) Hannes Reinecke
2010-03-30 17:21 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox