From 038631af2a65fc3f2c9793be24979983d5ca5442 Mon Sep 17 00:00:00 2001 From: Piotr Debski Date: Sun, 30 Jan 2022 02:21:35 +0100 Subject: [PATCH] fix for issue 1021 cache device path for standby mode in Try `casadm --help | -H' for more information. Signed-off-by: Piotr Debski --- casadm/cas_lib.c | 6 +++++- ocf | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/casadm/cas_lib.c b/casadm/cas_lib.c index 25ca4b7..3a4c89f 100644 --- a/casadm/cas_lib.c +++ b/casadm/cas_lib.c @@ -2760,6 +2760,7 @@ int list_caches(unsigned int list_format, bool by_id_path) char status_buf[CACHE_STATE_LENGHT]; const char *tmp_status; char mode_string[12]; + char cache_ctrl_dev[MAX_STR_LEN]; float cache_flush_prog; float core_flush_prog; @@ -2782,9 +2783,12 @@ int list_caches(unsigned int list_format, bool by_id_path) tmp_status = get_cache_state_name(curr_cache->state); if (curr_cache->state & (1 << ocf_cache_state_standby)) { strncpy(mode_string, "-", sizeof(mode_string)); + snprintf(cache_ctrl_dev, sizeof(cache_ctrl_dev), + "/dev/cas-cache-%d", curr_cache->id); } else { snprintf(mode_string, sizeof(mode_string), "%s", cache_mode_to_name(curr_cache->mode)); + strncpy(cache_ctrl_dev, "-", sizeof(cache_ctrl_dev)); } } @@ -2795,7 +2799,7 @@ int list_caches(unsigned int list_format, bool by_id_path) curr_cache->device, /* device path */ tmp_status, /* cache status */ mode_string, /* write policy */ - "-" /* device */); + cache_ctrl_dev /* device */); for (j = 0; j < curr_cache->core_count; ++j) { char* core_path; diff --git a/ocf b/ocf index c176dae..6af8d20 160000 --- a/ocf +++ b/ocf @@ -1 +1 @@ -Subproject commit c176daeec118430d6d1854302b9f9603b9b084ca +Subproject commit 6af8d20ceef70898364b5742feba5d6b2743fb29