@@ -1258,9 +1258,12 @@ static int do_end_io(struct multipath *m, struct request *clone,
if (error == -EOPNOTSUPP)
return error;
- r = eval_scsi_error(clone->errors, clone->sense, clone->sense_len);
- if (r != DM_ENDIO_REQUEUE)
- return r;
+ if (blk_rq_scsi_error(clone)) {
+ r = eval_scsi_error(clone->errors, clone->sense,
+ clone->sense_len);
+ if (r != DM_ENDIO_REQUEUE)
+ return r;
+ }
if (mpio->pgpath)
fail_path(mpio->pgpath);
@@ -723,6 +723,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
}
req->errors = result;
+ req->cmd_flags |= REQ_SCSI_ERROR;
+
if (sense_valid && req->sense) {
int len = 8 + cmd->sense_buffer[7];
@@ -115,6 +115,7 @@ enum rq_flag_bits {
__REQ_NOIDLE, /* Don't anticipate more IO after this one */
__REQ_IO_STAT, /* account I/O stat */
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
+ __REQ_SCSI_ERROR, /* errors are SCSI result codes */
__REQ_NR_BITS, /* stops here */
};
@@ -144,6 +145,7 @@ enum rq_flag_bits {
#define REQ_NOIDLE (1 << __REQ_NOIDLE)
#define REQ_IO_STAT (1 << __REQ_IO_STAT)
#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
+#define REQ_SCSI_ERROR (1 << __REQ_SCSI_ERROR)
#define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \
REQ_FAILFAST_DRIVER)
@@ -606,6 +608,7 @@ enum {
#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
#define blk_rq_io_stat(rq) ((rq)->cmd_flags & REQ_IO_STAT)
#define blk_rq_quiet(rq) ((rq)->cmd_flags & REQ_QUIET)
+#define blk_rq_scsi_error(rq) ((rq)->cmd_flags & REQ_SCSI_ERROR)
#define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq)))