From 99adff393e67eb9c6b9f9de539389abfb078b68f Mon Sep 17 00:00:00 2001 From: shuaihaowei Date: Mon, 27 Oct 2025 15:43:18 +0800 Subject: [PATCH] fix pv_major and pv_minor report field type (cherry picked from commit 95eafc88212c5a9e097f4779a1dc0d6673445e76) --- ...major-and-pv_minor-report-field-type.patch | 30 +++++++++++++++++++ lvm2.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0037-fix-pv_major-and-pv_minor-report-field-type.patch diff --git a/0037-fix-pv_major-and-pv_minor-report-field-type.patch b/0037-fix-pv_major-and-pv_minor-report-field-type.patch new file mode 100644 index 0000000..70468b8 --- /dev/null +++ b/0037-fix-pv_major-and-pv_minor-report-field-type.patch @@ -0,0 +1,30 @@ +From 0e9fe272bcf508cc2e0c99d986a5c95abb2b93d0 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Mon, 31 Jul 2023 13:37:34 +0200 +Subject: [PATCH] report: fix pv_major and pv_minor report field type + +We incorrectly marked pv_major and pv_minor fields as being of string +type, even though the values were already correctly handled as integers +internally. This confused -S|--select that tried to compare string +values instead of integers. +--- + source/lib/report/columns.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/report/columns.h b/lib/report/columns.h +index 8719a7e..6a47b83 100644 +--- a/lib/report/columns.h ++++ b/lib/report/columns.h +@@ -179,8 +179,8 @@ FIELD(LABEL, label, STR, "Fmt", type, 0, pvfmt, pv_fmt, "Type of metadata.", 0) + FIELD(LABEL, label, STR, "PV UUID", type, 38, pvuuid, pv_uuid, "Unique identifier.", 0) + FIELD(LABEL, label, SIZ, "DevSize", dev, 0, devsize, dev_size, "Size of underlying device in current units.", 0) + FIELD(LABEL, label, STR, "PV", dev, 10, dev_name, pv_name, "Name.", 0) +-FIELD(LABEL, label, STR, "Maj", dev, 0, devmajor, pv_major, "Device major number.", 0) +-FIELD(LABEL, label, STR, "Min", dev, 0, devminor, pv_minor, "Device minor number.", 0) ++FIELD(LABEL, label, SNUM, "Maj", dev, 0, devmajor, pv_major, "Device major number.", 0) ++FIELD(LABEL, label, SNUM, "Min", dev, 0, devminor, pv_minor, "Device minor number.", 0) + FIELD(LABEL, label, SIZ, "PMdaFree", type, 9, pvmdafree, pv_mda_free, "Free metadata area space on this device in current units.", 0) + FIELD(LABEL, label, SIZ, "PMdaSize", type, 9, pvmdasize, pv_mda_size, "Size of smallest metadata area on this device in current units.", 0) + FIELD(LABEL, label, NUM, "PExtVsn", type, 0, pvextvsn, pv_ext_vsn, "PV header extension version.", 0) +-- +2.43.0 diff --git a/lvm2.spec b/lvm2.spec index 8e2fb2b..aa14879 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.14 -Release: 18 +Release: 19 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -85,6 +85,7 @@ Patch33: 0033-dm-event-release-buffer-on-dm_event_get_version.patch Patch34: 0034-dmstats-Fix-memory-leak-on-error-path.patch Patch35: 0035-fix-function-undeclared-in-libdm-common.c-and-dev-cache.c.patch Patch36: 0036-config-check-for-0-from-read.patch +Patch37: 0037-fix-pv_major-and-pv_minor-report-field-type.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -511,6 +512,9 @@ fi %changelog +* Mon Oct 27 2025 weishuaihao - 8:2.03.14-19 +- fix pv_major and pv_minor report field type + * Fri Mar 28 2025 chenrenhui - 8:2.03.14-18 - config: check for 0 from read -- Gitee