Map OCF error codes to errno in io path

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2021-11-25 14:09:08 +01:00
parent 57a3938872
commit d28881588d

View File

@ -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); cas_generic_end_io_acct(master->bio, master->start_time);
result = master->error ? -EIO : 0; result = map_cas_err_to_generic(master->error);
CAS_BIO_ENDIO(master->bio, master->master_size, CAS_ERRNO_TO_BLK_STS(result)); CAS_BIO_ENDIO(master->bio, master->master_size,
CAS_ERRNO_TO_BLK_STS(result));
cas_free_blk_data(master); cas_free_blk_data(master);
} }
@ -340,7 +341,7 @@ err:
static void blkdev_complete_discard(struct ocf_io *io, int error) static void blkdev_complete_discard(struct ocf_io *io, int error)
{ {
struct bio *bio = io->priv1; 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)); CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(result));
ocf_io_put(io); 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 bio *bio = io->priv1;
struct bd_object *bvol = io->priv2; struct bd_object *bvol = io->priv2;
int result = error ? -EIO : 0; int result = map_cas_err_to_generic(error);
ocf_io_put(io); ocf_io_put(io);