1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

writecache: fix lv_on_pmem

dev_is_pmem on pv->dev requires a pv segment or it could segfault.
This commit is contained in:
David Teigland 2021-06-02 10:51:12 -05:00
parent b725b5ea6e
commit 247f69f9aa

View File

@ -4412,6 +4412,9 @@ int lv_on_pmem(struct logical_volume *lv)
dm_list_iterate_items(seg, &lv->segments) {
for (s = 0; s < seg->area_count; s++) {
if (seg_type(seg, s) != AREA_PV)
continue;
pv = seg_pv(seg, s);
if (dev_is_pmem(lv->vg->cmd->dev_types, pv->dev)) {