From 73f24443e5b153b9310985f1fbeeb7d0193bfb8c Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 24 Oct 2024 11:54:41 +0200 Subject: [PATCH] check_pv_segments: resolve pv name once --- lib/metadata/pv_manip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c index 2b970f0ba..641980a89 100644 --- a/lib/metadata/pv_manip.c +++ b/lib/metadata/pv_manip.c @@ -398,9 +398,11 @@ int check_pv_segments(struct volume_group *vg) uint32_t start_pe, alloced; uint32_t pv_count = 0, free_count = 0, extent_count = 0; int ret = 1; + const char *pv_devname; dm_list_iterate_items(pvl, &vg->pvs) { pv = pvl->pv; + pv_devname = pv_dev_name(pv); segno = 0; start_pe = 0; alloced = 0; @@ -411,7 +413,7 @@ int check_pv_segments(struct volume_group *vg) /* FIXME Remove this next line eventually */ log_debug_alloc("%s %u: %6u %6u: %s(%u:%u)", - pv_dev_name(pv), segno++, peg->pe, peg->len, + pv_devname, segno++, peg->pe, peg->len, peg->lvseg ? peg->lvseg->lv->name : "NULL", peg->lvseg ? peg->lvseg->le : 0, s); /* FIXME Add details here on failure instead */