summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-26 09:40:37 +0200
committerMike Snitzer <snitzer@redhat.com>2017-05-01 18:19:03 -0400
commit7ed8578a96ad98231d8bf6388f776e034673e18a (patch)
tree91d1d822e1e9c1e04343486df3860b93b9c57836 /drivers/md/dm-mpath.c
parentb79f10eefd4bc450a595b93c75e3a9d159ac3885 (diff)
downloadop-kernel-dev-7ed8578a96ad98231d8bf6388f776e034673e18a.zip
op-kernel-dev-7ed8578a96ad98231d8bf6388f776e034673e18a.tar.gz
dm rq: change ->rq_end_io calling conventions
Instead of returning either a DM_ENDIO_* constant or an error code, add a new DM_ENDIO_DONE value that means keep errno as is. This allows us to easily keep the existing error code in case where we can't push back, and it also preparares for the new block level status codes with strict type checking. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r--drivers/md/dm-mpath.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 8b394a0..926a6bc 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1469,6 +1469,7 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
{
struct dm_mpath_io *mpio = get_mpio(map_context);
struct pgpath *pgpath = mpio->pgpath;
+ int r = DM_ENDIO_DONE;
/*
* We don't queue any clone request inside the multipath target
@@ -1484,14 +1485,18 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
if (error && !noretry_error(error)) {
struct multipath *m = ti->private;
- error = DM_ENDIO_REQUEUE;
+ r = DM_ENDIO_REQUEUE;
if (pgpath)
fail_path(pgpath);
if (atomic_read(&m->nr_valid_paths) == 0 &&
- !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))
- error = dm_report_EIO(m);
+ !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {
+ if (error == -EIO)
+ error = dm_report_EIO(m);
+ /* complete with the original error */
+ r = DM_ENDIO_DONE;
+ }
}
if (pgpath) {
@@ -1501,7 +1506,7 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes);
}
- return error;
+ return r;
}
static int do_end_io_bio(struct multipath *m, struct bio *clone,
OpenPOWER on IntegriCloud