summaryrefslogtreecommitdiff
path: root/lib/report
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2020-02-25 16:20:05 -0600
committerDavid Teigland <teigland@redhat.com>2020-06-10 12:13:48 -0500
commitce772bfab976d89f6a35a442434d1a49ceb634c7 (patch)
tree2f9c0bc5c555927bf728426207dadc3fed536d41 /lib/report
parent240062a18365a7f6725ebcf1b035a6e0a3b12803 (diff)
downloadlvm2-ce772bfab976d89f6a35a442434d1a49ceb634c7.tar.gz
writecache: show error in lv_health_status and lv_attr
lv_attr is 'E' and lv_health_status is 'error' when dm-writecache status reports error.
Diffstat (limited to 'lib/report')
-rw-r--r--lib/report/report.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/report/report.c b/lib/report/report.c
index 170df6995..e1c630576 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -3802,6 +3802,12 @@ static int _lvhealthstatus_disp(struct dm_report *rh, struct dm_pool *mem,
health = "failed";
else if (lvdm->seg_status.cache->read_only)
health = "metadata_read_only";
+ } else if (lv_is_writecache(lv) && (lvdm->seg_status.type != SEG_STATUS_NONE)) {
+ if (lvdm->seg_status.type != SEG_STATUS_WRITECACHE)
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(health_undef),
+ GET_FIELD_RESERVED_VALUE(health_undef));
+ if (lvdm->seg_status.writecache->error)
+ health = "error";
} else if (lv_is_thin_pool(lv) && (lvdm->seg_status.type != SEG_STATUS_NONE)) {
if (lvdm->seg_status.type != SEG_STATUS_THIN_POOL)
return _field_set_value(field, GET_FIRST_RESERVED_NAME(health_undef),