Merge pull request #53 from mmichal10/validate-core-config
Validate core config
This commit is contained in:
commit
f0b59c58d9
@ -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)"
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user