aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-06-03 09:38:02 +0200
committerJens Axboe <axboe@fb.com>2017-06-09 09:27:32 -0600
commit846785e6a5725de4f0788e78e101961566a77d2a (patch)
tree4dd5c24f6ebb9e4adb4ab920a6bdd99531e1300c /drivers/md/dm.c
parentdm mpath: merge do_end_io_bio into multipath_end_io_bio (diff)
downloadlinux-dev-846785e6a5725de4f0788e78e101961566a77d2a.tar.xz
linux-dev-846785e6a5725de4f0788e78e101961566a77d2a.zip
dm: don't return errnos from ->map
Instead use the special DM_MAPIO_KILL return value to return -EIO just like we do for the request based path. Note that dm-log-writes returned -ENOMEM in a few places, which now becomes -EIO instead. No consumer treats -ENOMEM special so this shouldn't be an issue (and it should use a mempool to start with to make guaranteed progress). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to '')
-rw-r--r--drivers/md/dm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 6ef9500226c0..499f8209bacf 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1084,18 +1084,24 @@ static void __map_bio(struct dm_target_io *tio)
r = ti->type->map(ti, clone);
dm_offload_end(&o);
- if (r == DM_MAPIO_REMAPPED) {
+ switch (r) {
+ case DM_MAPIO_SUBMITTED:
+ break;
+ case DM_MAPIO_REMAPPED:
/* the bio has been remapped so dispatch it */
-
trace_block_bio_remap(bdev_get_queue(clone->bi_bdev), clone,
tio->io->bio->bi_bdev->bd_dev, sector);
-
generic_make_request(clone);
- } else if (r < 0 || r == DM_MAPIO_REQUEUE) {
+ break;
+ case DM_MAPIO_KILL:
+ r = -EIO;
+ /*FALLTHRU*/
+ case DM_MAPIO_REQUEUE:
/* error the io and bail out, or requeue it if needed */
dec_pending(tio->io, r);
free_tio(tio);
- } else if (r != DM_MAPIO_SUBMITTED) {
+ break;
+ default:
DMWARN("unimplemented target map return value: %d", r);
BUG();
}