--- drivers/md/dm-mpath.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) Index: linux-2.6/drivers/md/dm-mpath.c =================================================================== --- linux-2.6.orig/drivers/md/dm-mpath.c +++ linux-2.6/drivers/md/dm-mpath.c @@ -1264,17 +1264,17 @@ static bool scsi_uld_should_retry(struct int sense_len = req->sense_len; int r = 1; - if (req->cmd_flags & REQ_DISCARD) - /* - * Pass all discard request failures up. - * FIXME: only fail_path if the discard failed due to a - * transport problem. This requires precise understanding - * of the underlying failure (e.g. the SCSI sense). - */ - return 0; - if (host_byte(result) != DID_OK) - return r; + switch (host_byte(result)) { + case DID_ABORT: + case DID_ERROR: /* TODO: not all hbas are equal on DID_ERROR? */ + case DID_RESET: + case DID_SOFT_ERROR: + r = 0; + default: + /* retry DID_NO_CONNECT, DID_TRANSPORT*, etc */ + return r; + } if (msg_byte(result) != COMMAND_COMPLETE) return r; @@ -1286,6 +1286,7 @@ static bool scsi_uld_should_retry(struct if (status_byte(result) == CHECK_CONDITION && !scsi_normalize_sense(sense, sense_len, &sshdr)) { switch (sshdr.sense_key) { + case ILLEGAL_REQUEST: case MEDIUM_ERROR: case DATA_PROTECT: case BLANK_CHECK: