diff --git a/WHATS_NEW b/WHATS_NEW index d622c9fba..f316054fd 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.140 - =================================== + Use brackets to signify LVs which are not visible when reporting lv_parent. Fix invalid memory read when reporting cache LV policy_name (2.02.126). Version 2.02.139 - 8th January 2016 diff --git a/lib/report/report.c b/lib/report/report.c index bb2736fc5..17aa5c0bd 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -1655,15 +1655,15 @@ static int _lvfullname_disp(struct dm_report *rh, struct dm_pool *mem, static int _lvparent_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute__((unused))) + const void *data, void *private) { const struct logical_volume *lv = (const struct logical_volume *) data; - char *repstr; + struct logical_volume *parent_lv = lv_parent(lv); - if (!(repstr = lv_parent_dup(mem, lv))) - return_0; + if (!parent_lv) + return _field_set_value(field, "", NULL); - return _field_set_value(field, repstr, NULL); + return _lvname_disp(rh, mem, field, parent_lv, private); } static int _do_datalv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),