diff --git a/modules/cas_cache/volume/vol_block_dev_top.c b/modules/cas_cache/volume/vol_block_dev_top.c index 2a682ea..e4ed365 100644 --- a/modules/cas_cache/volume/vol_block_dev_top.c +++ b/modules/cas_cache/volume/vol_block_dev_top.c @@ -204,8 +204,9 @@ static void blkdev_complete_data_master(struct blk_data *master, int error) cas_generic_end_io_acct(master->bio, master->start_time); - result = master->error ? -EIO : 0; - CAS_BIO_ENDIO(master->bio, master->master_size, CAS_ERRNO_TO_BLK_STS(result)); + result = map_cas_err_to_generic(master->error); + CAS_BIO_ENDIO(master->bio, master->master_size, + CAS_ERRNO_TO_BLK_STS(result)); cas_free_blk_data(master); } @@ -340,7 +341,7 @@ err: static void blkdev_complete_discard(struct ocf_io *io, int error) { struct bio *bio = io->priv1; - int result = error ? -EIO : 0; + int result = map_cas_err_to_generic(error); CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(result)); ocf_io_put(io); @@ -382,7 +383,7 @@ static void blkdev_complete_flush(struct ocf_io *io, int error) { struct bio *bio = io->priv1; struct bd_object *bvol = io->priv2; - int result = error ? -EIO : 0; + int result = map_cas_err_to_generic(error); ocf_io_put(io);