aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r--drivers/md/dm-mpath.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 926a6bcb32c8..3df056b73b66 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -447,7 +447,7 @@ failed:
447 * it has been invoked. 447 * it has been invoked.
448 */ 448 */
449#define dm_report_EIO(m) \ 449#define dm_report_EIO(m) \
450({ \ 450do { \
451 struct mapped_device *md = dm_table_get_md((m)->ti->table); \ 451 struct mapped_device *md = dm_table_get_md((m)->ti->table); \
452 \ 452 \
453 pr_debug("%s: returning EIO; QIFNP = %d; SQIFNP = %d; DNFS = %d\n", \ 453 pr_debug("%s: returning EIO; QIFNP = %d; SQIFNP = %d; DNFS = %d\n", \
@@ -455,8 +455,7 @@ failed:
455 test_bit(MPATHF_QUEUE_IF_NO_PATH, &(m)->flags), \ 455 test_bit(MPATHF_QUEUE_IF_NO_PATH, &(m)->flags), \
456 test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &(m)->flags), \ 456 test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &(m)->flags), \
457 dm_noflush_suspending((m)->ti)); \ 457 dm_noflush_suspending((m)->ti)); \
458 -EIO; \ 458} while (0)
459})
460 459
461/* 460/*
462 * Map cloned requests (request-based multipath) 461 * Map cloned requests (request-based multipath)
@@ -481,7 +480,8 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq,
481 if (!pgpath) { 480 if (!pgpath) {
482 if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) 481 if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))
483 return DM_MAPIO_DELAY_REQUEUE; 482 return DM_MAPIO_DELAY_REQUEUE;
484 return dm_report_EIO(m); /* Failed */ 483 dm_report_EIO(m); /* Failed */
484 return DM_MAPIO_KILL;
485 } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) || 485 } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) ||
486 test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) { 486 test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) {
487 if (pg_init_all_paths(m)) 487 if (pg_init_all_paths(m))
@@ -558,7 +558,8 @@ static int __multipath_map_bio(struct multipath *m, struct bio *bio, struct dm_m
558 if (!pgpath) { 558 if (!pgpath) {
559 if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) 559 if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))
560 return DM_MAPIO_REQUEUE; 560 return DM_MAPIO_REQUEUE;
561 return dm_report_EIO(m); 561 dm_report_EIO(m);
562 return -EIO;
562 } 563 }
563 564
564 mpio->pgpath = pgpath; 565 mpio->pgpath = pgpath;
@@ -1493,7 +1494,7 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
1493 if (atomic_read(&m->nr_valid_paths) == 0 && 1494 if (atomic_read(&m->nr_valid_paths) == 0 &&
1494 !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) { 1495 !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {
1495 if (error == -EIO) 1496 if (error == -EIO)
1496 error = dm_report_EIO(m); 1497 dm_report_EIO(m);
1497 /* complete with the original error */ 1498 /* complete with the original error */
1498 r = DM_ENDIO_DONE; 1499 r = DM_ENDIO_DONE;
1499 } 1500 }
@@ -1524,8 +1525,10 @@ static int do_end_io_bio(struct multipath *m, struct bio *clone,
1524 fail_path(mpio->pgpath); 1525 fail_path(mpio->pgpath);
1525 1526
1526 if (atomic_read(&m->nr_valid_paths) == 0 && 1527 if (atomic_read(&m->nr_valid_paths) == 0 &&
1527 !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) 1528 !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {
1528 return dm_report_EIO(m); 1529 dm_report_EIO(m);
1530 return -EIO;
1531 }
1529 1532
1530 /* Queue for the daemon to resubmit */ 1533 /* Queue for the daemon to resubmit */
1531 dm_bio_restore(get_bio_details_from_bio(clone), clone); 1534 dm_bio_restore(get_bio_details_from_bio(clone), clone);