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

report: fix off-by-one error when reporting LV segment's metadata device extent count

Commit a3f484f812 used "-1" two times by
mistake for the extent count when reporting seg_metadata_le_ranges.
This commit is contained in:
Peter Rajnoha 2016-01-19 14:42:51 +01:00
parent acf1e84e8c
commit 2a4ef78c4a

View File

@ -55,7 +55,7 @@ static struct dm_list *_format_pvsegs(struct dm_pool *mem, const struct lv_segme
switch (metadata_areas_only ? seg_metatype(seg, s) : seg_type(seg, s)) {
case AREA_LV:
lv = metadata_areas_only ? seg_metalv(seg, s) : seg_lv(seg, s);
seg_len = metadata_areas_only ? seg_metalv(seg, s)->le_count - 1 : seg_lv(seg, s)->le_count;
seg_len = metadata_areas_only ? seg_metalv(seg, s)->le_count : seg_lv(seg, s)->le_count;
visible = lv_is_visible(lv);
name = lv->name;
extent = metadata_areas_only ? seg_le(seg, s) : 0;