public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: handle HARDWARE_ERROR sense correctly
@ 2008-12-04 20:49 Alan Stern
  2008-12-04 21:02 ` James Bottomley
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Stern @ 2008-12-04 20:49 UTC (permalink / raw)
  To: James Bottomley, Boaz Harrosh; +Cc: SCSI development list

This patch (as1183) fixes a bug in scsi_check_sense().  The routine is
documented as returning one of SUCCESS, FAILED, or NEEDS_RETRY.  But
in the HARDWARE_ERROR case it can return ADD_TO_MLQUEUE.  And since it
does this without bothering to increment the retry count, it can lead
to an infinite retry loop.

The fix is to return NEEDS_RETRY instead.  Then the caller,
scsi_decide_disposition(), will do the right thing.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

---

Index: usb-2.6/drivers/scsi/scsi_error.c
===================================================================
--- usb-2.6.orig/drivers/scsi/scsi_error.c
+++ usb-2.6/drivers/scsi/scsi_error.c
@@ -330,7 +330,7 @@ static int scsi_check_sense(struct scsi_
 
 	case HARDWARE_ERROR:
 		if (scmd->device->retry_hwerror)
-			return ADD_TO_MLQUEUE;
+			return NEEDS_RETRY;
 		else
 			return SUCCESS;
 


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

end of thread, other threads:[~2008-12-17 15:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-04 20:49 [PATCH] SCSI: handle HARDWARE_ERROR sense correctly Alan Stern
2008-12-04 21:02 ` James Bottomley
2008-12-04 21:45   ` Alan Stern
2008-12-04 23:39     ` Mike Anderson
2008-12-08 15:10       ` Alan Stern
2008-12-16 15:27       ` Alan Stern
2008-12-16 19:14         ` James Bottomley
2008-12-16 19:56           ` Alan Stern
2008-12-16 21:49             ` James Bottomley
2008-12-17 15:09               ` Alan Stern
2008-12-05 14:41   ` Kai Makisara
2008-12-05 15:45     ` James Bottomley

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