Skip to content

Commit a127567

Browse files
Keith Buschaxboe
authored andcommitted
dm mpath: 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 e1f425e commit a127567

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

drivers/md/dm-mpath.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,21 +1475,6 @@ static void activate_path_work(struct work_struct *work)
14751475
activate_or_offline_path(pgpath);
14761476
}
14771477

1478-
static int noretry_error(blk_status_t error)
1479-
{
1480-
switch (error) {
1481-
case BLK_STS_NOTSUPP:
1482-
case BLK_STS_NOSPC:
1483-
case BLK_STS_TARGET:
1484-
case BLK_STS_NEXUS:
1485-
case BLK_STS_MEDIUM:
1486-
return 1;
1487-
}
1488-
1489-
/* Anything else could be a path failure, so should be retried */
1490-
return 0;
1491-
}
1492-
14931478
static int multipath_end_io(struct dm_target *ti, struct request *clone,
14941479
blk_status_t error, union map_info *map_context)
14951480
{
@@ -1508,7 +1493,7 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
15081493
* request into dm core, which will remake a clone request and
15091494
* clone bios for it and resubmit it later.
15101495
*/
1511-
if (error && !noretry_error(error)) {
1496+
if (error && blk_path_error(error)) {
15121497
struct multipath *m = ti->private;
15131498

15141499
r = DM_ENDIO_REQUEUE;
@@ -1544,7 +1529,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
15441529
unsigned long flags;
15451530
int r = DM_ENDIO_DONE;
15461531

1547-
if (!*error || noretry_error(*error))
1532+
if (!*error || !blk_path_error(*error))
15481533
goto done;
15491534

15501535
if (pgpath)

0 commit comments

Comments
 (0)