mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-02 13:47:42 +03:00
a83d611a86
Fix regression caused by commit c2d4330f27277717bc3b684b702189079b257b77 which removed the dm_pool_strdup for the cache policy name in _cache_policy_disp report function. This regression was hit with buffered reporting only (which is used by default). The reason is that for buffered reporting, we're iterating over LVs in VG (process_each_lv) while gathering all the information that is needed for the report. In this case, the LV's cache policy name has not been duped, but only the pointer to the original VG buffer was stored. When the LV iteration finished, the VG buffer was freed and any report to output called later (dm_report_output call) accessed already freed VG data. This didn't appear if unbuffered reporting was used (--unbuffered) because in this case, the data were reported to output as soon as they were processed, hence it was reported to output before the VG data was freed.