Skip to content

Commit e1f425e

Browse files
Keith Buschaxboe
authored andcommitted
nvme/multipath: Use blk_path_error
Uses common code for determining if an error should be retried on alternate path. Acked-by: Mike Snitzer <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9111e56 commit e1f425e

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

drivers/nvme/host/multipath.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,7 @@ bool nvme_req_needs_failover(struct request *req, blk_status_t error)
3737
{
3838
if (!(req->cmd_flags & REQ_NVME_MPATH))
3939
return false;
40-
41-
switch (error) {
42-
case BLK_STS_NOTSUPP:
43-
case BLK_STS_NOSPC:
44-
case BLK_STS_TARGET:
45-
case BLK_STS_NEXUS:
46-
case BLK_STS_MEDIUM:
47-
case BLK_STS_PROTECTION:
48-
return false;
49-
}
50-
51-
/* Everything else could be a path failure, so should be retried */
52-
return true;
40+
return blk_path_error(error);
5341
}
5442

5543
void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)

0 commit comments

Comments
 (0)