mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
scsi: core: Make scsi_result_to_blk_status() recognize CONDITION MET
Ensure that CONDITION MET and other non-zero status values that indicate success are translated into BLK_STS_OK. Signed-off-by: Bart Van Assche <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Damien Le Moal <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Lee Duncan <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
a77b32d8b1
commit
f4abab3f18
1 changed files with 9 additions and 0 deletions
|
|
@ -733,6 +733,15 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
|
|||
static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result)
|
||||
{
|
||||
switch (host_byte(result)) {
|
||||
case DID_OK:
|
||||
/*
|
||||
* Also check the other bytes than the status byte in result
|
||||
* to handle the case when a SCSI LLD sets result to
|
||||
* DRIVER_SENSE << 24 without setting SAM_STAT_CHECK_CONDITION.
|
||||
*/
|
||||
if (scsi_status_is_good(result) && (result & ~0xff) == 0)
|
||||
return BLK_STS_OK;
|
||||
return BLK_STS_IOERR;
|
||||
case DID_TRANSPORT_FAILFAST:
|
||||
return BLK_STS_TRANSPORT;
|
||||
case DID_TARGET_FAILURE:
|
||||
|
|
|
|||
Loading…
Reference in a new issue