summaryrefslogtreecommitdiff
path: root/lib/report
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2020-11-11 15:10:15 -0600
committerDavid Teigland <teigland@redhat.com>2020-11-11 15:10:15 -0600
commit5fef89361d45797d2e478419caff4528b5ac6150 (patch)
treed28cfb68cee11355c1db9159ebee0bd898780ea3 /lib/report
parent2317ba393459a8848a83b43891188520c6a06559 (diff)
downloadlvm2-5fef89361d45797d2e478419caff4528b5ac6150.tar.gz
integrity: display total mismatches at raid LV level
Each integrity image in a raid LV reports its own number of integrity mismatches, e.g. lvs -o integritymismatches vg/lv_rimage_0 lvs -o integritymismatches vg/lv_rimage_1 In addition to this, allow the total number of integrity mismatches from all images to be displayed for the raid LV. lvs -o integritymismatches vg/lv shows the number of mismatches from both lv_rimage_0 and lv_rimage_1.
Diffstat (limited to 'lib/report')
-rw-r--r--lib/report/report.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/report/report.c b/lib/report/report.c
index 73a150a7e..2f50a990c 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -3338,6 +3338,10 @@ static int _integritymismatches_disp(struct dm_report *rh __attribute__((unused)
if (lv_is_integrity(lv) && lv_integrity_mismatches(lv->vg->cmd, lv, &mismatches))
return dm_report_field_uint64(rh, field, &mismatches);
+ if (lv_is_raid(lv) && lv_raid_has_integrity(lv) &&
+ lv_raid_integrity_total_mismatches(lv->vg->cmd, lv, &mismatches))
+ return dm_report_field_uint64(rh, field, &mismatches);
+
return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
}