From c5e432633735d339d064021f09a2fa250cf5b46a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 17 Jul 2023 12:43:39 +0200 Subject: [PATCH] active: device name limit is NAME_LEN Use existing NAME_LEN instead of 257 value. Add missing backtrace. --- lib/activate/activate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 41d4b9b13..f559a68a0 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -2721,11 +2721,11 @@ static int _remove_dm_dev_by_name(const char *name) /* Work all segments of @lv removing any existing, closed "*-missing_N_0" sub devices. */ static int _lv_remove_any_missing_subdevs(struct logical_volume *lv) { - if (lv) { - uint32_t seg_no = 0; - char name[257]; - struct lv_segment *seg; + char name[NAME_LEN]; + struct lv_segment *seg; + uint32_t seg_no = 0; + if (lv) { dm_list_iterate_items(seg, &lv->segments) { if (dm_snprintf(name, sizeof(name), "%s-%s-missing_%u_0", seg->lv->vg->name, seg->lv->name, seg_no) < 0) return_0;