From 212e06944aa0f4bb9a369804a49038a3adcc188b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E4=BB=B2=E4=BC=9F?= Date: Fri, 8 Nov 2024 15:19:10 +0800 Subject: [PATCH] backport patch --- 0024-backport-Fix-Python-script.patch | 30 ++ ...detect-non-empty-GPT-partition-table.patch | 246 ++++++++++++++++ ...e-default-log-for-json-output-format.patch | 277 ++++++++++++++++++ lvm2.spec | 11 +- 4 files changed, 563 insertions(+), 1 deletion(-) create mode 100644 0024-backport-Fix-Python-script.patch create mode 100644 0025-backport-detect-non-empty-GPT-partition-table.patch create mode 100644 0026-backport-use-default-log-for-json-output-format.patch diff --git a/0024-backport-Fix-Python-script.patch b/0024-backport-Fix-Python-script.patch new file mode 100644 index 0000000..1919d7f --- /dev/null +++ b/0024-backport-Fix-Python-script.patch @@ -0,0 +1,30 @@ +From 493d8908fbd859d744941731bda83682817c2e51 Mon Sep 17 00:00:00 2001 +From: Tobias Stoeckmann +Date: Fri, 13 Sep 2024 18:35:18 +0200 +Subject: [PATCH] lvmdbusd: Fix Python script + +The thread does not contain field "damon" but "daemon". + +Actually found with codespell. + +Signed-off-by: Tobias Stoeckmann +--- + daemons/lvmdbusd/main.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/daemons/lvmdbusd/main.py b/daemons/lvmdbusd/main.py +index c9821e07e6..b8238df473 100644 +--- a/daemons/lvmdbusd/main.py ++++ b/daemons/lvmdbusd/main.py +@@ -214,7 +214,7 @@ def main(): + cfg.loop = GLib.MainLoop() + + for thread in thread_list: +- thread.damon = True ++ thread.daemon = True + thread.start() + + # In all cases we are going to monitor for udev until we get an +-- +GitLab + diff --git a/0025-backport-detect-non-empty-GPT-partition-table.patch b/0025-backport-detect-non-empty-GPT-partition-table.patch new file mode 100644 index 0000000..b38f6db --- /dev/null +++ b/0025-backport-detect-non-empty-GPT-partition-table.patch @@ -0,0 +1,246 @@ +From 84cabd068b190aad2dc6639aa3b68b6197a8b4ea Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Wed, 4 Sep 2024 15:30:42 +0200 +Subject: [PATCH 1/3] filter: partitioned: also detect non-empty GPT partition + table + +We already detect msdos partition table. If it is empty, that is, there +is just the partition header and no actual partitions defined, then the +filter-partitioned passes, otherwise not. + +Do the same for GPT partition table. +--- + lib/device/dev-type.c | 80 +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 77 insertions(+), 3 deletions(-) + +diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c +index c7c2a838d5..e26adcc317 100644 +--- a/lib/device/dev-type.c ++++ b/lib/device/dev-type.c +@@ -505,6 +505,11 @@ int dev_get_partition_number(struct device *dev, int *num) + #define PART_MAGIC 0xAA55 + #define PART_MAGIC_OFFSET UINT64_C(0x1FE) + #define PART_OFFSET UINT64_C(0x1BE) ++#define PART_TYPE_GPT_PMBR UINT8_C(0xEE) ++ ++#define PART_GPT_HEADER_OFFSET_LBA 0x01 ++#define PART_GPT_MAGIC 0x5452415020494645UL /* "EFI PART" string */ ++#define PART_GPT_ENTRIES_FIELDS_OFFSET UINT64_C(0x48) + + struct partition { + uint8_t boot_ind; +@@ -570,6 +575,65 @@ static int _is_partitionable(struct dev_types *dt, struct device *dev) + return 1; + } + ++static int _has_gpt_partition_table(struct device *dev) ++{ ++ unsigned int pbs, lbs; ++ uint64_t entries_start; ++ uint32_t nr_entries, sz_entry, i; ++ ++ struct { ++ uint64_t magic; ++ /* skip fields we're not interested in */ ++ uint8_t skip[PART_GPT_ENTRIES_FIELDS_OFFSET - sizeof(uint64_t)]; ++ uint64_t part_entries_lba; ++ uint32_t nr_part_entries; ++ uint32_t sz_part_entry; ++ } __attribute__((packed)) gpt_header; ++ ++ struct { ++ uint64_t part_type_guid; ++ /* not interested in any other fields */ ++ } __attribute__((packed)) gpt_part_entry; ++ ++ if (!dev_get_direct_block_sizes(dev, &pbs, &lbs)) ++ return_0; ++ ++ if (!dev_read_bytes(dev, PART_GPT_HEADER_OFFSET_LBA * lbs, sizeof(gpt_header), &gpt_header)) ++ return_0; ++ ++ /* the gpt table is always written using LE on disk */ ++ ++ if (le64_to_cpu(gpt_header.magic) != PART_GPT_MAGIC) ++ return_0; ++ ++ entries_start = le64_to_cpu(gpt_header.part_entries_lba) * lbs; ++ nr_entries = le32_to_cpu(gpt_header.nr_part_entries); ++ sz_entry = le32_to_cpu(gpt_header.sz_part_entry); ++ ++ for (i = 0; i < nr_entries; i++) { ++ if (!dev_read_bytes(dev, entries_start + i * sz_entry, ++ sizeof(gpt_part_entry), &gpt_part_entry)) ++ return_0; ++ ++ /* just check if the guid is nonzero, no need to call le64_to_cpu here */ ++ if (gpt_part_entry.part_type_guid) ++ return 1; ++ } ++ ++ return 0; ++} ++ ++/* ++ * Check if there's a partition table present on the device dev, either msdos or gpt. ++ * Returns: ++ * ++ * 1 - if it has a partition table with at least one real partition defined ++ * (note: the gpt's PMBR partition alone does not count as a real partition) ++ * ++ * 0 - if it has no partition table, ++ * - or if it does have a partition table, but without any partition defined, ++ * - or on error ++ */ + static int _has_partition_table(struct device *dev) + { + int ret = 0; +@@ -594,10 +658,20 @@ static int _has_partition_table(struct device *dev) + break; + } + /* Must have at least one non-empty partition */ +- if (buf.part[p].nr_sects) +- ret = 1; ++ if (buf.part[p].nr_sects) { ++ /* ++ * If this is GPT's PMBR, then also ++ * check for gpt partition table. ++ */ ++ if (buf.part[p].sys_ind == PART_TYPE_GPT_PMBR) ++ ret = _has_gpt_partition_table(dev); ++ else ++ ret = 1; ++ } + } +- } ++ } else ++ /* Check for gpt partition table. */ ++ ret = _has_gpt_partition_table(dev); + + return ret; + } +-- +GitLab + + +From d5d2c98980b4d02368f75d892e748647d00d3ae8 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Wed, 18 Sep 2024 10:26:18 +0200 +Subject: [PATCH 2/3] dev-type: add prefix to differentiate msdos and gpt + constants + +--- + lib/device/dev-type.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c +index e26adcc317..eab6401688 100644 +--- a/lib/device/dev-type.c ++++ b/lib/device/dev-type.c +@@ -502,10 +502,10 @@ int dev_get_partition_number(struct device *dev, int *num) + } + + /* See linux/genhd.h and fs/partitions/msdos */ +-#define PART_MAGIC 0xAA55 +-#define PART_MAGIC_OFFSET UINT64_C(0x1FE) +-#define PART_OFFSET UINT64_C(0x1BE) +-#define PART_TYPE_GPT_PMBR UINT8_C(0xEE) ++#define PART_MSDOS_MAGIC 0xAA55 ++#define PART_MSDOS_MAGIC_OFFSET UINT64_C(0x1FE) ++#define PART_MSDOS_OFFSET UINT64_C(0x1BE) ++#define PART_MSDOS_TYPE_GPT_PMBR UINT8_C(0xEE) + + #define PART_GPT_HEADER_OFFSET_LBA 0x01 + #define PART_GPT_MAGIC 0x5452415020494645UL /* "EFI PART" string */ +@@ -639,7 +639,7 @@ static int _has_partition_table(struct device *dev) + int ret = 0; + unsigned p; + struct { +- uint8_t skip[PART_OFFSET]; ++ uint8_t skip[PART_MSDOS_OFFSET]; + struct partition part[4]; + uint16_t magic; + } __attribute__((packed)) buf; /* sizeof() == SECTOR_SIZE */ +@@ -650,7 +650,7 @@ static int _has_partition_table(struct device *dev) + /* FIXME Check for other types of partition table too */ + + /* Check for msdos partition table */ +- if (buf.magic == xlate16(PART_MAGIC)) { ++ if (buf.magic == xlate16(PART_MSDOS_MAGIC)) { + for (p = 0; p < 4; ++p) { + /* Table is invalid if boot indicator not 0 or 0x80 */ + if (buf.part[p].boot_ind & 0x7f) { +@@ -663,7 +663,7 @@ static int _has_partition_table(struct device *dev) + * If this is GPT's PMBR, then also + * check for gpt partition table. + */ +- if (buf.part[p].sys_ind == PART_TYPE_GPT_PMBR) ++ if (buf.part[p].sys_ind == PART_MSDOS_TYPE_GPT_PMBR) + ret = _has_gpt_partition_table(dev); + else + ret = 1; +-- +GitLab + + +From 4524778b2324dd7975879e0efd15dcf39df325af Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Fri, 20 Sep 2024 10:32:35 +0200 +Subject: [PATCH 3/3] tests: add pvcreate-partition.sh + +--- + test/shell/pvcreate-partition.sh | 42 ++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + create mode 100644 test/shell/pvcreate-partition.sh + +diff --git a/test/shell/pvcreate-partition.sh b/test/shell/pvcreate-partition.sh +new file mode 100644 +index 0000000000..22fc927b09 +--- /dev/null ++++ b/test/shell/pvcreate-partition.sh +@@ -0,0 +1,42 @@ ++#!/usr/bin/env bash ++ ++# Copyright (C) 2024 Red Hat, Inc. All rights reserved. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions ++# of the GNU General Public License v.2. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ ++ ++SKIP_WITH_LVMPOLLD=1 ++SKIP_WITH_LVMLOCKD=1 ++ ++. lib/inittest ++ ++which sfdisk || skip ++ ++aux prepare_devs 1 4 ++ ++pvcreate_on_dev_with_part_table() { ++ local dev=$1 ++ local type=$2 ++ ++ # pvcreate passes on empty partition table ++ echo "label:$type" | sfdisk "$dev" ++ pvcreate -y "$dev" ++ pvremove "$dev" ++ ++ # pvcreate fails if there's at least 1 partition ++ echo "label:$type" | sfdisk "$dev" ++ echo "1MiB 1" | sfdisk "$dev" ++ not pvcreate "$dev" 2>err ++ grep "device is partitioned" err ++ ++ aux wipefs_a "$dev" ++} ++ ++pvcreate_on_dev_with_part_table "$dev1" "dos" ++pvcreate_on_dev_with_part_table "$dev1" "gpt" +-- +GitLab + diff --git a/0026-backport-use-default-log-for-json-output-format.patch b/0026-backport-use-default-log-for-json-output-format.patch new file mode 100644 index 0000000..36d8100 --- /dev/null +++ b/0026-backport-use-default-log-for-json-output-format.patch @@ -0,0 +1,277 @@ +From 8281f7c1115b2e0f951b5c39c6fb0544fecb8de6 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Wed, 20 Mar 2024 12:41:57 +0100 +Subject: [PATCH 1/5] config: use default log/command_log_report=1 for + json/json_std output format + +log/command_log_report config setting defaults to 1 now if json or json_std +output format is used (either by setting report/output_format config +setting or using --reportformat cmd line arg). + +This means that if we use json/json_std output format, the command log +messages are then part of the json output too, not interleaved as +unstructured text mixed with the json output. + +If log/command_log_report is set explicitly in the config, then we still +respect that, no matter what output format is used currently. In this +case, users can still separate and redirect the output by using +LVM_OUT_FD, LVM_ERR_FD and LVM_REPORT_FD so that the different types +do not interleave with the json/json_std output. +--- + lib/config/config_settings.h | 9 ++++++--- + tools/reporter.c | 5 +++++ + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h +index f56ff7b85a..59e890811f 100644 +--- a/lib/config/config_settings.h ++++ b/lib/config/config_settings.h +@@ -859,7 +859,10 @@ cfg(log_report_command_log_CFG, "report_command_log", log_CFG_SECTION, CFG_PROFI + "option. Use log/command_log_cols and log/command_log_sort settings\n" + "to define fields to display and sort fields for the log report.\n" + "You can also use log/command_log_selection to define selection\n" +- "criteria used each time the log is reported.\n") ++ "criteria used each time the log is reported.\n" ++ "Note that if report/output_format (or --reporformat command line\n" ++ "option) is set to json or json_std, then log/report_command_log=1\n" ++ "is default.\n") + + cfg(log_command_log_sort_CFG, "command_log_sort", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED | CFG_DISALLOW_INTERACTIVE, CFG_TYPE_STRING, DEFAULT_COMMAND_LOG_SORT, vsn(2, 2, 158), NULL, 0, NULL, + "List of columns to sort by when reporting command log.\n" +@@ -1853,8 +1856,8 @@ cfg(report_output_format_CFG, "output_format", report_CFG_SECTION, CFG_PROFILABL + " Compared to original \"json\" format:\n" + " - it does not use double quotes around numeric values,\n" + " - it uses 'null' for undefined numeric values,\n" +- " - it prints string list as proper JSON array of strings instead of a single string." +- "\n") ++ " - it prints string list as proper JSON array of strings instead of a single string.\n" ++ "Note that if json or json_std output format is used, then log/command_log_report=1 is default.\n") + + cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL, 0, NULL, + "Do not print empty values for all report fields.\n" +diff --git a/tools/reporter.c b/tools/reporter.c +index 6bba239f06..732688c305 100644 +--- a/tools/reporter.c ++++ b/tools/reporter.c +@@ -1490,6 +1490,7 @@ int report_format_init(struct cmd_context *cmd) + int config_set = find_config_tree_node(cmd, report_output_format_CFG, NULL) != NULL; + const char *config_format_str = find_config_tree_str(cmd, report_output_format_CFG, NULL); + const char *format_str = arg_str_value(cmd, reportformat_ARG, config_set ? config_format_str : NULL); ++ int report_command_log_config_set = find_config_tree_node(cmd, log_report_command_log_CFG, NULL) != NULL; + int report_command_log; + struct report_args args = {0}; + struct single_report_args *single_args; +@@ -1504,8 +1505,12 @@ int report_format_init(struct cmd_context *cmd) + : DM_REPORT_GROUP_SINGLE; + } else if (!strcmp(format_str, REPORT_FORMAT_NAME_JSON)) { + args.report_group_type = DM_REPORT_GROUP_JSON; ++ if (!report_command_log_config_set) ++ report_command_log = 1; + } else if (!strcmp(format_str, REPORT_FORMAT_NAME_JSON_STD)) { + args.report_group_type = DM_REPORT_GROUP_JSON_STD; ++ if (!report_command_log_config_set) ++ report_command_log = 1; + } else { + log_error("%s: unknown report format.", format_str); + log_error("Supported report formats: %s, %s, %s.", +-- +GitLab + + +From 3eecdcbd641fa715b3d7819458155c66a9572004 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Wed, 20 Mar 2024 15:00:47 +0100 +Subject: [PATCH 2/5] config_settings: fix typo + +--- + lib/config/config_settings.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h +index 59e890811f..e90ba0b5d7 100644 +--- a/lib/config/config_settings.h ++++ b/lib/config/config_settings.h +@@ -1843,7 +1843,7 @@ cfg(report_output_format_CFG, "output_format", report_CFG_SECTION, CFG_PROFILABL + "If there is more than one report per command, then the format\n" + "is applied for all reports. You can also change output format\n" + "directly on command line using --reportformat option which\n" +- "has precedence over log/output_format setting.\n" ++ "has precedence over report/output_format setting.\n" + "Accepted values:\n" + " basic\n" + " Original format with columns and rows. If there is more than\n" +-- +GitLab + + +From 14dbf6ca7bdb84cc450f6ead702efcf6c0e6764c Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Wed, 20 Mar 2024 13:58:04 +0100 +Subject: [PATCH 3/5] reporter: simplify checking output format setting in + report_format_init + +--- + tools/reporter.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tools/reporter.c b/tools/reporter.c +index 732688c305..bee1c271ca 100644 +--- a/tools/reporter.c ++++ b/tools/reporter.c +@@ -1487,9 +1487,8 @@ int devtypes(struct cmd_context *cmd, int argc, char **argv) + + int report_format_init(struct cmd_context *cmd) + { +- int config_set = find_config_tree_node(cmd, report_output_format_CFG, NULL) != NULL; + const char *config_format_str = find_config_tree_str(cmd, report_output_format_CFG, NULL); +- const char *format_str = arg_str_value(cmd, reportformat_ARG, config_set ? config_format_str : NULL); ++ const char *format_str = arg_str_value(cmd, reportformat_ARG, config_format_str); + int report_command_log_config_set = find_config_tree_node(cmd, log_report_command_log_CFG, NULL) != NULL; + int report_command_log; + struct report_args args = {0}; +-- +GitLab + + +From 0e8c429e30bef6e321f787d2b80b5fe2fc82d421 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Wed, 20 Mar 2024 15:01:45 +0100 +Subject: [PATCH 4/5] make: generate + +--- + conf/example.conf.in | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/conf/example.conf.in b/conf/example.conf.in +index ac4f3b0b79..94ca06a616 100644 +--- a/conf/example.conf.in ++++ b/conf/example.conf.in +@@ -801,6 +801,9 @@ log { + # to define fields to display and sort fields for the log report. + # You can also use log/command_log_selection to define selection + # criteria used each time the log is reported. ++ # Note that if report/output_format (or --reporformat command line ++ # option) is set to json or json_std, then log/report_command_log=1 ++ # is default. + # This configuration option has an automatic default value. + # report_command_log = 0 + +@@ -1989,7 +1992,7 @@ report { + # If there is more than one report per command, then the format + # is applied for all reports. You can also change output format + # directly on command line using --reportformat option which +- # has precedence over log/output_format setting. ++ # has precedence over report/output_format setting. + # Accepted values: + # basic + # Original format with columns and rows. If there is more than +@@ -2003,6 +2006,7 @@ report { + # - it does not use double quotes around numeric values, + # - it uses 'null' for undefined numeric values, + # - it prints string list as proper JSON array of strings instead of a single string. ++ # Note that if json or json_std output format is used, then log/command_log_report=1 is default. + # This configuration option has an automatic default value. + # output_format = "basic" + +-- +GitLab + + +From 7fdba39b3fd1460a3260a9d581ae267c329df0cf Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Mon, 3 Jun 2024 14:54:02 +0200 +Subject: [PATCH 5/5] tests: add tests for autoswitching to JSON format for log + messages + +--- + test/shell/report-format.sh | 55 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 55 insertions(+) + +diff --git a/test/shell/report-format.sh b/test/shell/report-format.sh +index e02d61b278..99e3e9af95 100644 +--- a/test/shell/report-format.sh ++++ b/test/shell/report-format.sh +@@ -26,6 +26,39 @@ lvcreate -l1 -T $vg/$lv1 + lvcreate -l1 -n $lv2 --addtag lv_tag1 -an $vg + lvcreate -l1 -n $lv3 --addtag lv_tag3 --addtag lv_tag1 --addtag lv_tag2 $vg + ++check_json_vs_log() { ++ local format_param ++ local log_output=$2 ++ local extra_cmd_line=$3 ++ ++ if [ -z $1 ]; then ++ format_param="" ++ else ++ format_param="--reportformat $1" ++ fi ++ ++ not lvs $format_param $extra_cmd_line -o name $vg/lvolX 2>&1 | tee "$OUT_LOG_FILE" ++ ++ if [ "$log_output" = "log_in_report" ]; then ++ # { ++ # "report": [ ++ # ... ++ # ] ++ # "log": [ ++ # { ... "log_message": "Failed to find logical volume" ...}, ++ # ... ++ # } ++ grep -E "^[[:space:]]*\"log\": \[" out ++ grep -E "^[[:space:]]*\{.*\"log_message\":\"Failed to find logical volume.*\}" out ++ elif [ "$log_output" = "direct_log" ]; then ++ # Failed to find logical volume ... ++ not grep -E "^[[:space:]]*\"log\": \[" out ++ grep -E "[[:space:]]*Failed to find logical volume" out ++ else ++ false ++ fi ++} ++ + aux lvmconf "report/output_format = basic" + lvs -o name,kernel_major,data_percent,tags | tee "$OUT_LOG_FILE" + +@@ -39,6 +72,14 @@ grep -E "^[[:space:]]*${lv1}[[:space:]]*[[:digit:]]+[[:space:]]*[[:digit:]]+.[[: + grep -E "^[[:space:]]*${lv2}[[:space:]]*-1[[:space:]]*lv_tag1[[:space:]]*\$" out + grep -E "^[[:space:]]*${lv3}[[:space:]]*[[:digit:]]+[[:space:]]*lv_tag1,lv_tag2,lv_tag3\$" out + ++check_json_vs_log "" direct_log "" ++check_json_vs_log "" direct_log "--config log/report_command_log=1" ++ ++check_json_vs_log json log_in_report "" ++check_json_vs_log json_std log_in_report "" ++ ++check_json_vs_log json direct_log "--config log/report_command_log=0" ++check_json_vs_log json_std direct_log "--config log/report_command_log=0" + + aux lvmconf "report/output_format = json" + lvs -o name,kernel_major,data_percent,tags | tee "$OUT_LOG_FILE" +@@ -57,6 +98,9 @@ grep -E "^[[:space:]]*{\"lv_name\":\"$lv1\", \"lv_kernel_major\":\"[[:digit:]]+\ + grep -E "^[[:space:]]*{\"lv_name\":\"$lv2\", \"lv_kernel_major\":\"-1\", \"data_percent\":\"\", \"lv_tags\":\"lv_tag1\"},\$" out + grep -E "^[[:space:]]*{\"lv_name\":\"$lv3\", \"lv_kernel_major\":\"[[:digit:]]+\", \"data_percent\":\"\", \"lv_tags\":\"lv_tag1,lv_tag2,lv_tag3\"}\$" out + ++check_json_vs_log "" log_in_report "" ++check_json_vs_log "" direct_log "--config log/report_command_log=0" ++ + aux lvmconf "report/output_format = json_std" + lvs -o name,kernel_major,data_percent,tags | tee "$OUT_LOG_FILE" + # { +@@ -74,4 +118,15 @@ grep -E "^[[:space:]]*{\"lv_name\":\"$lv1\", \"lv_kernel_major\":[[:digit:]]+, \ + grep -E "^[[:space:]]*{\"lv_name\":\"$lv2\", \"lv_kernel_major\":-1, \"data_percent\":null, \"lv_tags\":\[\"lv_tag1\"\]},\$" out + grep -E "^[[:space:]]*{\"lv_name\":\"$lv3\", \"lv_kernel_major\":[[:digit:]]+, \"data_percent\":null, \"lv_tags\":\[\"lv_tag1\",\"lv_tag2\",\"lv_tag3\"\]}\$" out + ++check_json_vs_log "" log_in_report "" ++check_json_vs_log "" direct_log "--config log/report_command_log=0" ++ ++aux lvmconf "log/report_command_log = 0" ++check_json_vs_log "" direct_log "" ++check_json_vs_log "" log_in_report "--config log/report_command_log=1" ++ ++aux lvmconf "log/report_command_log = 1" ++check_json_vs_log "" log_in_report "" ++check_json_vs_log "" direct_log "--config log/report_command_log=0" ++ + vgremove -ff $vg +-- +GitLab + diff --git a/lvm2.spec b/lvm2.spec index 24e641a..a571596 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.21 -Release: 14 +Release: 15 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -72,6 +72,9 @@ Patch20: 0020-udev-create-dev-disk-by-label-symlinks-for-DM-devs-t.patch Patch21: 0021-lvmcache-fix-memleaks-on-list-removal.patch Patch22: 0022-dmstats-Fix-memory-leak-on-error-path.patch Patch23: 0023-fix-function-undeclared-in-libdm-common.c-and-dev-cache.c.patch +Patch24: 0024-backport-Fix-Python-script.patch +Patch25: 0025-backport-detect-non-empty-GPT-partition-table.patch +Patch26: 0026-backport-use-default-log-for-json-output-format.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -498,6 +501,12 @@ fi %changelog +* Fri Nov 08 2024 shenzhongwei - 8:2.03.21-15 +- Type:update +- ID:NA +- SUG:NA +- DESC:backport patch + * Tue Nov 05 2024 shenzhongwei - 8:2.03.21-14 - Type:bugfix - ID:NA -- Gitee