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

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.
This commit is contained in:
David Teigland 2020-02-25 16:20:05 -06:00
parent 240062a183
commit ce772bfab9
3 changed files with 13 additions and 0 deletions

View File

@ -1412,6 +1412,9 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_
} else if (lvdm->seg_status.type == SEG_STATUS_THIN) { } else if (lvdm->seg_status.type == SEG_STATUS_THIN) {
if (lvdm->seg_status.thin->fail) if (lvdm->seg_status.thin->fail)
repstr[8] = 'F'; repstr[8] = 'F';
} else if (lvdm->seg_status.type == SEG_STATUS_WRITECACHE) {
if (lvdm->seg_status.writecache->error)
repstr[8] = 'E';
} else if (lvdm->seg_status.type == SEG_STATUS_UNKNOWN) } else if (lvdm->seg_status.type == SEG_STATUS_UNKNOWN)
repstr[8] = 'X'; /* Unknown */ repstr[8] = 'X'; /* Unknown */

View File

@ -3802,6 +3802,12 @@ static int _lvhealthstatus_disp(struct dm_report *rh, struct dm_pool *mem,
health = "failed"; health = "failed";
else if (lvdm->seg_status.cache->read_only) else if (lvdm->seg_status.cache->read_only)
health = "metadata_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)) { } else if (lv_is_thin_pool(lv) && (lvdm->seg_status.type != SEG_STATUS_NONE)) {
if (lvdm->seg_status.type != SEG_STATUS_THIN_POOL) if (lvdm->seg_status.type != SEG_STATUS_THIN_POOL)
return _field_set_value(field, GET_FIRST_RESERVED_NAME(health_undef), return _field_set_value(field, GET_FIRST_RESERVED_NAME(health_undef),

View File

@ -74,5 +74,9 @@ Related to Thin Logical Volumes: (F)ailed.
.br .br
(F)ailed is set when related thin pool enters Failed state and no further I/O (F)ailed is set when related thin pool enters Failed state and no further I/O
is permitted at all. is permitted at all.
.IP
Related to writecache logical volumes: (E)rror.
.br
(E)rror is set dm-writecache reports an error.
.IP 10 3 .IP 10 3
s(k)ip activation: this volume is flagged to be skipped during activation. s(k)ip activation: this volume is flagged to be skipped during activation.