aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/ub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r--drivers/block/ub.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index b87ad77e5bb5..5c6a6e89d2fb 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -792,10 +792,6 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
792 scsi_status = 0; 792 scsi_status = 0;
793 } else { 793 } else {
794 if (cmd->act_len != cmd->len) { 794 if (cmd->act_len != cmd->len) {
795 if ((cmd->key == MEDIUM_ERROR ||
796 cmd->key == UNIT_ATTENTION) &&
797 ub_rw_cmd_retry(sc, lun, urq, cmd) == 0)
798 return;
799 scsi_status = SAM_STAT_CHECK_CONDITION; 795 scsi_status = SAM_STAT_CHECK_CONDITION;
800 } else { 796 } else {
801 scsi_status = 0; 797 scsi_status = 0;
@@ -811,7 +807,10 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
811 else 807 else
812 scsi_status = DID_ERROR << 16; 808 scsi_status = DID_ERROR << 16;
813 } else { 809 } else {
814 if (cmd->error == -EIO) { 810 if (cmd->error == -EIO &&
811 (cmd->key == 0 ||
812 cmd->key == MEDIUM_ERROR ||
813 cmd->key == UNIT_ATTENTION)) {
815 if (ub_rw_cmd_retry(sc, lun, urq, cmd) == 0) 814 if (ub_rw_cmd_retry(sc, lun, urq, cmd) == 0)
816 return; 815 return;
817 } 816 }