From 60192c447e5ec835a06ddebc4cfc9c7912d1f97b Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 26 Jun 2019 12:21:47 -0400 Subject: [PATCH 1/2] Fix typos in configuration script Signed-off-by: Michal Mielewczyk --- configure.d/1_append_bio.conf | 2 +- configure.d/2_make_req.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.d/1_append_bio.conf b/configure.d/1_append_bio.conf index 8fcfbef..e11804a 100644 --- a/configure.d/1_append_bio.conf +++ b/configure.d/1_append_bio.conf @@ -9,7 +9,7 @@ if compile_module "struct bio b;blk_rq_append_bio(NULL, &b)" "linux/blkdev.h" then add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\ - blk_rq_append_bio(rq, bounce_bio" + blk_rq_append_bio(rq, bounce_bio)" else add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\ blk_rq_append_bio(rq, &bounce_bio)" diff --git a/configure.d/2_make_req.conf b/configure.d/2_make_req.conf index b294d4a..5039bbc 100644 --- a/configure.d/2_make_req.conf +++ b/configure.d/2_make_req.conf @@ -28,7 +28,7 @@ static inline struct request *cas_blk_make_request(struct request_queue *q, struct bio *bounce_bio = bio; int ret; cas_blk_queue_bounce(q, &bounce_bio); - ret = cas_blk_rq_append_bio(rq, bounce_bio); + ret = cas_blk_rq_append_bio(rq, &bounce_bio); if (unlikely(ret)) { blk_put_request(rq); return ERR_PTR(ret); From db534a70b6ca0613fd373e6be02abfc3a4e53eab Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 26 Jun 2019 12:23:28 -0400 Subject: [PATCH 2/2] Check if given core device exists. Signed-off-by: Michal Mielewczyk --- modules/cas_cache/layer_cache_management.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index 383755c..7badc91 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -436,6 +436,7 @@ out_bdev: int cache_mngt_prepare_core_cfg(struct ocf_mngt_core_config *cfg, struct kcas_insert_core *cmd_info) { + struct block_device *bdev; int result; if (strnlen(cmd_info->core_path_name, MAX_STR_LEN) >= MAX_STR_LEN) @@ -452,6 +453,11 @@ int cache_mngt_prepare_core_cfg(struct ocf_mngt_core_config *cfg, return 0; } + bdev = lookup_bdev(cfg->uuid.data); + if (IS_ERR(bdev)) + return -OCF_ERR_INVAL_VOLUME_TYPE; + bdput(bdev); + if (cmd_info->update_path) return 0;