@@ -238,7 +238,8 @@ void dm_cell_error(struct dm_bio_prison *prison,
dm_cell_release(prison, cell, &bios);
while ((bio = bio_list_pop(&bios))) {
- bio->bi_status = error;
+ if (error)
+ bio->bi_status = error;
bio_endio(bio);
}
}
@@ -565,7 +565,8 @@ static void dmio_complete(unsigned long error, void *context)
{
struct dm_buffer *b = context;
- b->bio.bi_status = error ? BLK_STS_IOERR : 0;
+ if (error)
+ b->bio.bi_status = BLK_STS_IOERR;
b->bio.bi_end_io(&b->bio);
}
@@ -614,7 +615,8 @@ static void inline_endio(struct bio *bio)
*/
bio_reset(bio);
- bio->bi_status = status;
+ if (status)
+ bio->bi_status = status;
end_fn(bio);
}
@@ -1488,7 +1488,8 @@ static void crypt_dec_pending(struct dm_crypt_io *io)
else
kfree(io->integrity_metadata);
- base_bio->bi_status = error;
+ if (error)
+ base_bio->bi_status = error;
bio_endio(base_bio);
}
@@ -651,6 +651,9 @@ static int __multipath_map_bio(struct multipath *m, struct bio *bio,
mpio->pgpath = pgpath;
+ /* FIXME If the bio was chained, this could
+ * over-write an error... is that possible?
+ */
bio->bi_status = 0;
bio_set_dev(bio, pgpath->path.dev->bdev);
bio->bi_opf |= REQ_FAILFAST_TRANSPORT;
@@ -563,7 +563,8 @@ static void error_bio_list(struct bio_list *bios, blk_status_t error)
struct bio *bio;
while ((bio = bio_list_pop(bios))) {
- bio->bi_status = error;
+ if (error)
+ bio->bi_status = error;
bio_endio(bio);
}
}
@@ -503,7 +503,8 @@ static void verity_finish_io(struct dm_verity_io *io, blk_status_t status)
struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_io_data_size);
bio->bi_end_io = io->orig_bi_end_io;
- bio->bi_status = status;
+ if (status)
+ bio->bi_status = status;
verity_fec_finish_io(io);
@@ -637,7 +637,8 @@ static int dmz_end_io(struct dm_target *ti, struct bio *bio, blk_status_t *error
return DM_ENDIO_INCOMPLETE;
/* Done */
- bio->bi_status = bioctx->status;
+ if (bioctx->status)
+ bio->bi_status = bioctx->status;
if (bioctx->zone) {
struct dm_zone *zone = bioctx->zone;