summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2008-04-19 14:35:30 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-02 10:25:52 -0700
commit82fe26ba7a21d9bcc77e6142c941683eede32940 (patch)
tree3c3e2795ca536aba1a25d4cde1e91a5150a4acee /drivers/block
parent2c51ae70ede5a90d8ccb67d965c1b4e20fc4e110 (diff)
downloadlwn-82fe26ba7a21d9bcc77e6142c941683eede32940.tar.gz
lwn-82fe26ba7a21d9bcc77e6142c941683eede32940.zip
ub: Tune retries
Make ub to fail faster in hopeless cases. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block')
-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)
scsi_status = 0;
} else {
if (cmd->act_len != cmd->len) {
- if ((cmd->key == MEDIUM_ERROR ||
- cmd->key == UNIT_ATTENTION) &&
- ub_rw_cmd_retry(sc, lun, urq, cmd) == 0)
- return;
scsi_status = SAM_STAT_CHECK_CONDITION;
} else {
scsi_status = 0;
@@ -811,7 +807,10 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
else
scsi_status = DID_ERROR << 16;
} else {
- if (cmd->error == -EIO) {
+ if (cmd->error == -EIO &&
+ (cmd->key == 0 ||
+ cmd->key == MEDIUM_ERROR ||
+ cmd->key == UNIT_ATTENTION)) {
if (ub_rw_cmd_retry(sc, lun, urq, cmd) == 0)
return;
}