Merge pull request #1136 from robertbaldyga/cache-mode-standby-error

Return error on cache mode change in standby mode
This commit is contained in:
Robert Baldyga 2022-03-28 14:33:08 +02:00 committed by GitHub
commit f73ab567ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2792,6 +2792,11 @@ int cache_mngt_set_cache_mode(const char *cache_name, size_t name_len,
if (result)
return result;
if (ocf_cache_is_standby(cache)) {
result = -OCF_ERR_CACHE_STANDBY;
goto put;
}
old_mode = ocf_cache_get_mode(cache);
if (old_mode == mode) {
printk(KERN_INFO "%s is in requested cache mode already\n", cache_name);