Merge pull request #53 from mmichal10/validate-core-config

Validate core config
This commit is contained in:
Adam Rutkowski 2019-06-27 05:54:49 -04:00 committed by GitHub
commit f0b59c58d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -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)"

View File

@ -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);

View File

@ -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;