Rework for RHEL8.5
Rework for RHEL8.5 compatibility to avoid potential bug of exiting queue after IO completion on a different CPU. Targeted RHEL kernel version corrected. Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
This commit is contained in:
@@ -182,7 +182,6 @@ static void blkdev_defer_bio(struct bd_object *bvol, struct bio *bio,
|
||||
if (!context) {
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio),
|
||||
CAS_ERRNO_TO_BLK_STS(-ENOMEM));
|
||||
cas_blk_queue_exit(bvol);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +206,6 @@ static void blkdev_complete_data_master(struct blk_data *master, int error)
|
||||
result = map_cas_err_to_generic(master->error);
|
||||
CAS_BIO_ENDIO(master->bio, master->master_size,
|
||||
CAS_ERRNO_TO_BLK_STS(result));
|
||||
cas_blk_queue_exit(master->bvol);
|
||||
|
||||
cas_free_blk_data(master);
|
||||
}
|
||||
@@ -277,7 +275,6 @@ static int blkdev_handle_data_single(struct bd_object *bvol, struct bio *bio,
|
||||
data->bio = master_ctx->bio;
|
||||
data->master_size = master_ctx->master_size;
|
||||
data->start_time = master_ctx->start_time;
|
||||
data->bvol = bvol;
|
||||
master_ctx->data = data;
|
||||
}
|
||||
|
||||
@@ -308,7 +305,6 @@ static void blkdev_handle_data(struct bd_object *bvol, struct bio *bio)
|
||||
CAS_BIO_OP_FLAGS_FORMAT "\n", CAS_BIO_OP_FLAGS(bio));
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio),
|
||||
CAS_ERRNO_TO_BLK_STS(-EINVAL));
|
||||
cas_blk_queue_exit(bvol);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -334,26 +330,20 @@ static void blkdev_handle_data(struct bd_object *bvol, struct bio *bio)
|
||||
return;
|
||||
|
||||
err:
|
||||
if (split != bio) {
|
||||
if (split != bio)
|
||||
bio_put(split);
|
||||
}
|
||||
if (master_ctx.data) {
|
||||
if (master_ctx.data)
|
||||
blkdev_complete_data_master(master_ctx.data, error);
|
||||
}
|
||||
else {
|
||||
else
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(error));
|
||||
cas_blk_queue_exit(bvol);
|
||||
}
|
||||
}
|
||||
|
||||
static void blkdev_complete_discard(struct ocf_io *io, int error)
|
||||
{
|
||||
struct bio *bio = io->priv1;
|
||||
struct bd_object *bvol = io->priv2;
|
||||
int result = map_cas_err_to_generic(error);
|
||||
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(result));
|
||||
cas_blk_queue_exit(bvol);
|
||||
ocf_io_put(io);
|
||||
}
|
||||
|
||||
@@ -371,11 +361,10 @@ static void blkdev_handle_discard(struct bd_object *bvol, struct bio *bio)
|
||||
CAS_PRINT_RL(KERN_CRIT
|
||||
"Out of memory. Ending IO processing.\n");
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(-ENOMEM));
|
||||
cas_blk_queue_exit(bvol);
|
||||
return;
|
||||
}
|
||||
|
||||
ocf_io_set_cmpl(io, bio, bvol, blkdev_complete_discard);
|
||||
ocf_io_set_cmpl(io, bio, NULL, blkdev_complete_discard);
|
||||
|
||||
ocf_volume_submit_discard(io);
|
||||
}
|
||||
@@ -399,7 +388,6 @@ static void blkdev_complete_flush(struct ocf_io *io, int error)
|
||||
if (CAS_BIO_BISIZE(bio) == 0 || error) {
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio),
|
||||
CAS_ERRNO_TO_BLK_STS(result));
|
||||
cas_blk_queue_exit(bvol);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -422,7 +410,6 @@ static void blkdev_handle_flush(struct bd_object *bvol, struct bio *bio)
|
||||
CAS_PRINT_RL(KERN_CRIT
|
||||
"Out of memory. Ending IO processing.\n");
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(-ENOMEM));
|
||||
cas_blk_queue_exit(bvol);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,7 +431,6 @@ static void blkdev_submit_bio(struct bd_object *bvol, struct bio *bio)
|
||||
if (blkdev_can_hndl_bio(bio)) {
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio),
|
||||
CAS_ERRNO_TO_BLK_STS(-ENOTSUPP));
|
||||
cas_blk_queue_exit(bvol);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user