Merge pull request #371 from Ostrokrzew/load

Disable loading cache with 'force' flag
This commit is contained in:
Robert Baldyga 2020-05-22 13:52:16 +02:00 committed by GitHub
commit 1428376554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2075,7 +2075,14 @@ void ocf_mngt_cache_load(ocf_cache_t cache,
/* Load is not allowed in volatile metadata mode */ /* Load is not allowed in volatile metadata mode */
if (cache->metadata.is_volatile) if (cache->metadata.is_volatile)
OCF_CMPL_RET(cache, priv, -EINVAL); OCF_CMPL_RET(cache, priv, -OCF_ERR_INVAL);
/* Load is not allowed with 'force' flag on */
if (cfg->force) {
ocf_cache_log(cache, log_err, "Using 'force' flag is forbidden "
"for load operation.");
OCF_CMPL_RET(cache, priv, -OCF_ERR_INVAL);
}
result = _ocf_mngt_cache_validate_device_cfg(cfg); result = _ocf_mngt_cache_validate_device_cfg(cfg);
if (result) if (result)