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>
This commit is contained in:

committed by
Jens Axboe

parent
14ef1e4826
commit
846785e6a5
@@ -1207,14 +1207,14 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
|
||||
|
||||
r = log->type->in_sync(log, dm_rh_bio_to_region(ms->rh, bio), 0);
|
||||
if (r < 0 && r != -EWOULDBLOCK)
|
||||
return r;
|
||||
return DM_MAPIO_KILL;
|
||||
|
||||
/*
|
||||
* If region is not in-sync queue the bio.
|
||||
*/
|
||||
if (!r || (r == -EWOULDBLOCK)) {
|
||||
if (bio->bi_opf & REQ_RAHEAD)
|
||||
return -EIO;
|
||||
return DM_MAPIO_KILL;
|
||||
|
||||
queue_bio(ms, bio, rw);
|
||||
return DM_MAPIO_SUBMITTED;
|
||||
@@ -1226,7 +1226,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
|
||||
*/
|
||||
m = choose_mirror(ms, bio->bi_iter.bi_sector);
|
||||
if (unlikely(!m))
|
||||
return -EIO;
|
||||
return DM_MAPIO_KILL;
|
||||
|
||||
dm_bio_record(&bio_record->details, bio);
|
||||
bio_record->m = m;
|
||||
|
Reference in New Issue
Block a user