[SCSI] libfc: incorrect scsi host byte codes returned to scsi-ml
authorjohn fastabend <john.r.fastabend@intel.com>
Wed, 1 Dec 2010 00:18:39 +0000 (16:18 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 21 Dec 2010 18:24:21 +0000 (12:24 -0600)
commitac17ea8d7d45d0495316edff13faa0dfd6bb2225
tree6c8d0935d8b59ed3205fdfe9d074ab0b0a978fa2
parente90ff5ef0aab1d40f0e92a44d66f8d45a20d8c95
[SCSI] libfc: incorrect scsi host byte codes returned to scsi-ml

The fcp packet recovery handler fc_fcp_recover() is called
when errors occurr in a fcp session. Currently it is
generically setting the status code to FC_CMD_RECOVERY for
all error types. This results in DID_BUS_BUSY errors
being returned to the scsi-ml.

DID_BUS_BUSY errors indicate "BUS stayed busy through time
out period" according to scsi.h. Many of the error reported
by fc_rcp_recovery() are pkt errors. Here we update
fc_fcp_recovery to use better host byte codes.

With certain FAST FAIL flags set DID_BUS_BUSY and DID_ERROR
will have different behaviors this was causing dm multipath
to fail quickly in some cases where a retry would be a
better action.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_fcp.c