summaryrefslogtreecommitdiff
path: root/lib/cache_segtype
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-06-22 19:53:27 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-06-22 20:15:12 +0200
commit732928dda8eaf20ab2375e27ae641d58db08b8f4 (patch)
treed352ef2fd289d4fd52ea0d2fd29d3c81cd7b3898 /lib/cache_segtype
parent58a9f88b8c021a5e056b883053f257f1a898adf7 (diff)
downloadlvm2-732928dda8eaf20ab2375e27ae641d58db08b8f4.tar.gz
cache: fix lvdisplay --maps
'lvdisplay -m' tried to go through NULL policy settings, when such policy was not defined for CachedLV. Patch is fixing display of cache-pool without defined settings, as this is now a valid pool and we mostly want users to define these settings when actually really caching a LV.
Diffstat (limited to 'lib/cache_segtype')
-rw-r--r--lib/cache_segtype/cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index da23dae3c..7461b21f5 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -55,7 +55,8 @@ static void _cache_display(const struct lv_segment *seg)
log_print(" Mode\t\t%s", get_cache_mode_name(pool_seg));
log_print(" Policy\t\t%s", pool_seg->policy_name);
- if ((n = pool_seg->policy_settings->child))
+ if (pool_seg->policy_settings &&
+ (n = pool_seg->policy_settings->child))
dm_config_write_node(n, _cache_out_line, NULL);
log_print(" ");