提交 82fe26ba 编写于 作者: P Pete Zaitcev 提交者: Greg Kroah-Hartman

ub: Tune retries

Make ub to fail faster in hopeless cases.
Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 2c51ae70
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册