1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cache: fix lvdisplay output

Unused cache pool may have lots of fields actually undefined,
so avoid printing them, if they are not specified in metadata.
This commit is contained in:
Zdenek Kabelac 2017-06-22 20:05:26 +02:00
parent 732928dda8
commit 58e075f5fb
2 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.172 - Version 2.02.172 -
=============================== ===============================
Do not lvdisplay --maps unset settings of cache pool.
Fix lvdisplay --maps for cache pool without policy settings. Fix lvdisplay --maps for cache pool without policy settings.
Avoid using origin_only manipulation with cached device. Avoid using origin_only manipulation with cached device.
Support aborting of flushing cache LV. Support aborting of flushing cache LV.

View File

@ -51,8 +51,14 @@ static void _cache_display(const struct lv_segment *seg)
log_print(" Chunk size\t\t%s", log_print(" Chunk size\t\t%s",
display_size(seg->lv->vg->cmd, pool_seg->chunk_size)); display_size(seg->lv->vg->cmd, pool_seg->chunk_size));
if (pool_seg->cache_metadata_format != CACHE_METADATA_FORMAT_UNSELECTED)
log_print(" Metadata format\t%u", pool_seg->cache_metadata_format); log_print(" Metadata format\t%u", pool_seg->cache_metadata_format);
if (pool_seg->cache_mode != CACHE_MODE_UNSELECTED)
log_print(" Mode\t\t%s", get_cache_mode_name(pool_seg)); log_print(" Mode\t\t%s", get_cache_mode_name(pool_seg));
if (pool_seg->policy_name)
log_print(" Policy\t\t%s", pool_seg->policy_name); log_print(" Policy\t\t%s", pool_seg->policy_name);
if (pool_seg->policy_settings && if (pool_seg->policy_settings &&