[PATCH] SCSI: handle HARDWARE_ERROR sense correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>

---

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;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux