summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-06-03 09:38:06 +0200
committerJens Axboe <axboe@fb.com>2017-06-09 17:27:32 +0200
commit4e4cbee93d56137ebff722be022cae5f70ef84fb (patch)
tree4fa7345155599fc6bdd653fca8c5224ddf90a5be /drivers/md/dm-mpath.c
parentblk-mq: switch ->queue_rq return value to blk_status_t (diff)
downloadlinux-4e4cbee93d56137ebff722be022cae5f70ef84fb.tar.xz
linux-4e4cbee93d56137ebff722be022cae5f70ef84fb.zip
block: switch bios to blk_status_t
Replace bi_error with a new bi_status to allow for a clear conversion. Note that device mapper overloaded bi_error with a private value, which we'll have to keep arround at least for now and thus propagate to a proper blk_status_t value. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r--drivers/md/dm-mpath.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 39262e344ae1..a7d2e0840cc5 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -565,7 +565,7 @@ static int __multipath_map_bio(struct multipath *m, struct bio *bio, struct dm_m
mpio->pgpath = pgpath;
mpio->nr_bytes = nr_bytes;
- bio->bi_error = 0;
+ bio->bi_status = 0;
bio->bi_bdev = pgpath->path.dev->bdev;
bio->bi_opf |= REQ_FAILFAST_TRANSPORT;
@@ -623,10 +623,10 @@ static void process_queued_bios(struct work_struct *work)
r = __multipath_map_bio(m, bio, get_mpio_from_bio(bio));
switch (r) {
case DM_MAPIO_KILL:
- r = -EIO;
- /*FALLTHRU*/
+ bio->bi_status = BLK_STS_IOERR;
+ bio_endio(bio);
case DM_MAPIO_REQUEUE:
- bio->bi_error = r;
+ bio->bi_status = BLK_STS_DM_REQUEUE;
bio_endio(bio);
break;
case DM_MAPIO_REMAPPED:
@@ -1510,7 +1510,8 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
return r;
}
-static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int *error)
+static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
+ blk_status_t *error)
{
struct multipath *m = ti->private;
struct dm_mpath_io *mpio = get_mpio_from_bio(clone);
@@ -1518,7 +1519,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int *er
unsigned long flags;
int r = DM_ENDIO_DONE;
- if (!*error || noretry_error(errno_to_blk_status(*error)))
+ if (!*error || noretry_error(*error))
goto done;
if (pgpath)
@@ -1527,7 +1528,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int *er
if (atomic_read(&m->nr_valid_paths) == 0 &&
!test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {
dm_report_EIO(m);
- *error = -EIO;
+ *error = BLK_STS_IOERR;
goto done;
}