Check if given core device exists.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
60192c447e
commit
db534a70b6
@ -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