failover detach

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-10-07 12:58:42 +02:00
committed by ajrutkow
parent 86c7a9f5ae
commit 90d8584bd7
9 changed files with 382 additions and 107 deletions

View File

@@ -538,10 +538,13 @@ int cache_stats_conf(int ctrl_fd, const struct kcas_cache_info *cache_info,
char dev_path[MAX_STR_LEN];
int inactive_cores;
if (!by_id_path && get_dev_path(cache_info->cache_path_name, dev_path, sizeof(dev_path)) == SUCCESS)
if (strnlen(cache_info->cache_path_name, sizeof(cache_info->cache_path_name)) == 0) {
cache_path = "-";
} else if (!by_id_path && get_dev_path(cache_info->cache_path_name, dev_path, sizeof(dev_path)) == SUCCESS) {
cache_path = dev_path;
else
} else {
cache_path = cache_info->cache_path_name;
}
flush_progress = calculate_flush_progress(cache_info->info.dirty,
cache_info->info.flushed);