[SCSI] fix the new host byte settings (DID_TARGET_FAILURE and DID_NEXUS_FAILURE)
[deliverable/linux.git] / drivers / scsi / scsi_lib.c
index f85cfa6c47b5212982bcbfcd9065936c27360f3d..5b770e9e82c2035de9576236bf5dac59f4a0eafc 100644 (file)
@@ -682,11 +682,11 @@ static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result)
                error = -ENOLINK;
                break;
        case DID_TARGET_FAILURE:
-               cmd->result |= (DID_OK << 16);
+               set_host_byte(cmd, DID_OK);
                error = -EREMOTEIO;
                break;
        case DID_NEXUS_FAILURE:
-               cmd->result |= (DID_OK << 16);
+               set_host_byte(cmd, DID_OK);
                error = -EBADE;
                break;
        default:
@@ -1316,15 +1316,10 @@ static inline int scsi_target_queue_ready(struct Scsi_Host *shost,
        }
 
        if (scsi_target_is_busy(starget)) {
-               if (list_empty(&sdev->starved_entry))
-                       list_add_tail(&sdev->starved_entry,
-                                     &shost->starved_list);
+               list_move_tail(&sdev->starved_entry, &shost->starved_list);
                return 0;
        }
 
-       /* We're OK to process the command, so we can't be starved */
-       if (!list_empty(&sdev->starved_entry))
-               list_del_init(&sdev->starved_entry);
        return 1;
 }
 
This page took 0.035579 seconds and 5 git commands to generate.