diff --git a/casadm/cas_main.c b/casadm/cas_main.c index 8d5727bef..e6d656139 100644 --- a/casadm/cas_main.c +++ b/casadm/cas_main.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -2373,7 +2374,7 @@ static cli_command cas_commands[] = { .options = standby_params_options, .command_handle_opts = standby_handle_option, .handle = standby_handle, - .flags = CLI_SU_REQUIRED, + .flags = (CLI_COMMAND_BLOCKED | CLI_SU_REQUIRED), .help = standby_help, }, { diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index b4df56b8d..7028c2b6f 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -1882,6 +1882,15 @@ int cache_mngt_create_cache_cfg(struct ocf_mngt_cache_config *cfg, char cache_name[OCF_CACHE_NAME_SIZE]; uint16_t cache_id; + switch (cmd->init_cache) { + case CACHE_INIT_STANDBY_NEW: + case CACHE_INIT_STANDBY_LOAD: + printk(KERN_ERR "Standby mode is not supported!\n"); + return -ENOTSUP; + default: + break; + } + if (!cmd) return -OCF_ERR_INVAL; @@ -2453,6 +2462,15 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg, ocf_cache_mode_t cache_mode_meta; ocf_cache_line_size_t cache_line_size_meta; + switch (cmd->init_cache) { + case CACHE_INIT_STANDBY_NEW: + case CACHE_INIT_STANDBY_LOAD: + printk(KERN_ERR "Standby mode is not supported!\n"); + return -ENOTSUP; + default: + break; + } + if (!try_module_get(THIS_MODULE)) return -KCAS_ERR_SYSTEM; diff --git a/modules/cas_cache/service_ui_ioctl.c b/modules/cas_cache/service_ui_ioctl.c index f835bdb98..ae8fc7bd8 100644 --- a/modules/cas_cache/service_ui_ioctl.c +++ b/modules/cas_cache/service_ui_ioctl.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -381,6 +382,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd, case KCAS_IOCTL_STANDBY_DETACH: { struct kcas_standby_detach *cmd_info; + return -ENOTSUP; + GET_CMD_INFO(cmd_info, arg); retval = cache_mngt_standby_detach(cmd_info); @@ -391,6 +394,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd, struct kcas_standby_activate *cmd_info; struct ocf_mngt_cache_standby_activate_config cfg; + return -ENOTSUP; + GET_CMD_INFO(cmd_info, arg); retval = cache_mngt_create_cache_standby_activate_cfg(&cfg,