Pass name for newly initialized cache in array instead of pointer.
Unitl now pointer to local variable was passed to OCF and it's content could be overwriten after leaving function responsible for preparing cache config. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
@@ -1051,7 +1051,7 @@ int cache_mngt_prepare_cache_cfg(struct ocf_mngt_cache_config *cfg,
|
||||
memset(device_cfg, 0, sizeof(*device_cfg));
|
||||
memset(atomic_params, 0, sizeof(*atomic_params));
|
||||
|
||||
cfg->name = cache_name;
|
||||
strncpy(cfg->name, cache_name, OCF_CACHE_NAME_SIZE);
|
||||
cfg->cache_mode = cmd->caching_mode;
|
||||
cfg->cache_line_size = cmd->line_size;
|
||||
cfg->eviction_policy = cmd->eviction_policy;
|
||||
|
@@ -861,7 +861,7 @@ static int _cas_upgrade_restore_conf_main(struct cas_properties *cache_props,
|
||||
if (cache_mode >= ocf_cache_mode_max)
|
||||
cache_mode = ocf_cache_mode_default;
|
||||
|
||||
cfg.name = cache_name;
|
||||
strncpy(cfg.name, cache_name, OCF_CACHE_NAME_SIZE);
|
||||
cfg.cache_mode = cache_mode;
|
||||
/* cfg.eviction_policy = TODO */
|
||||
cfg.cache_line_size = cache_line_size;
|
||||
|
2
ocf
2
ocf
Submodule ocf updated: 8ed525ae7f...43e8905456
Reference in New Issue
Block a user