Additional patches for 9.0.0 lvm2

Resolves: #2031775 #1999733
This commit is contained in:
Marian Csontos 2022-01-04 22:23:29 +01:00
parent dc2ed04bad
commit 749a91ba75
5 changed files with 126 additions and 35 deletions

View File

@ -0,0 +1,25 @@
From bea731e8f60bb5d221483a8ccb398fd0e469e908 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Thu, 2 Dec 2021 12:40:52 -0600
Subject: [PATCH 1/3] print warning about unrecognized journal option value
(cherry picked from commit 455c29b10dfd15a9fa2ad72c8f9de77572328d39)
---
lib/log/log.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/log/log.c b/lib/log/log.c
index 7b4d537b3..5771a1d01 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -892,6 +892,7 @@ uint32_t log_journal_str_to_val(const char *str)
return LOG_JOURNAL_OUTPUT;
if (!strcasecmp(str, "debug"))
return LOG_JOURNAL_DEBUG;
+ log_warn("Ignoring unrecognized journal value.");
return 0;
}
--
2.31.1

View File

@ -0,0 +1,37 @@
From 9bd979855bd00851540fb647d7be01271a905e72 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Mon, 13 Dec 2021 08:59:31 -0600
Subject: [PATCH 2/3] lvcreate: include recent options
The permitted option list in lvcreate has not kept
up with command-lines.in.
(cherry picked from commit c28541eccdbf76191f7728035cd2a48d26d06922)
---
tools/lvcreate.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 0121c09a8..79af42685 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -824,12 +824,16 @@ static int _lvcreate_params(struct cmd_context *cmd,
autobackup_ARG,\
available_ARG,\
contiguous_ARG,\
+ devices_ARG,\
+ devicesfile_ARG,\
ignoreactivationskip_ARG,\
ignoremonitoring_ARG,\
+ journal_ARG,\
metadataprofile_ARG,\
monitor_ARG,\
mirrors_ARG,\
name_ARG,\
+ nohints_ARG,\
noudevsync_ARG,\
permission_ARG,\
persistent_ARG,\
--
2.31.1

View File

@ -0,0 +1,55 @@
From c265ff79d34e1c1c76db360a7c056c95c32ce216 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Thu, 2 Dec 2021 13:30:36 -0600
Subject: [PATCH 3/3] device_id: handle wwid with spaces or control characters
non-standard wwid can be reported from sysfs with spaces/etc.
replace with "_"
(cherry picked from commit ae54e75176d787de2d447ec40142f85f4dcc47c4)
---
lib/device/device_id.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 167bf661b..8b822e4c0 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -302,6 +302,7 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u
{
char sysbuf[PATH_MAX] = { 0 };
const char *idname = NULL;
+ int i;
if (idtype == DEV_ID_TYPE_SYS_WWID) {
read_sys_block(cmd, dev, "device/wwid", sysbuf, sizeof(sysbuf));
@@ -309,13 +310,10 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u
if (!sysbuf[0])
read_sys_block(cmd, dev, "wwid", sysbuf, sizeof(sysbuf));
- /* scsi_debug wwid begins "t10.Linux scsi_debug ..." */
- if (strstr(sysbuf, "scsi_debug"))
- sysbuf[0] = '\0';
-
/* qemu wwid begins "t10.ATA QEMU HARDDISK ..." */
if (strstr(sysbuf, "QEMU HARDDISK"))
sysbuf[0] = '\0';
+
}
else if (idtype == DEV_ID_TYPE_SYS_SERIAL)
@@ -353,6 +351,11 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u
return idname;
}
+ for (i = 0; i < strlen(sysbuf); i++) {
+ if (isblank(sysbuf[i]) || isspace(sysbuf[i]) || iscntrl(sysbuf[i]))
+ sysbuf[i] = '_';
+ }
+
if (!sysbuf[0])
goto_bad;
--
2.31.1

View File

@ -1,33 +0,0 @@
conf/example.conf.in | 5 +++--
lib/config/config_settings.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index b4a55ae..aaf73a4 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -121,8 +121,9 @@ devices {
#
# Example
# preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]
- #
- # This configuration option does not have a default value defined.
+ #
+ # This configuration option has an automatic default value.
+ # preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]
# Configuration option devices/use_devicesfile.
# Enable or disable the use of a devices file.
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 980fce6..9af8254 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -269,7 +269,7 @@ cfg(devices_hints_CFG, "hints", devices_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_
" Use no hints.\n"
"#\n")
-cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED , CFG_TYPE_STRING, NULL, vsn(1, 2, 19), NULL, 0, NULL,
+cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S^/dev/mpath/#S^/dev/mapper/mpath#S^/dev/[hs]d", vsn(1, 2, 19), NULL, 0, NULL,
"Select which path name to display for a block device.\n"
"If multiple path names exist for a block device, and LVM needs to\n"
"display a name for the device, the path names are matched against\n"

View File

@ -53,11 +53,13 @@ Name: lvm2
Epoch: %{rhel}
%endif
Version: 2.03.14
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
URL: http://sourceware.org/lvm2
Source0: ftp://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz
Patch1: lvm2-set-default-preferred_names.patch
Patch1: 0001-print-warning-about-unrecognized-journal-option-valu.patch
Patch2: 0002-lvcreate-include-recent-options.patch
Patch3: 0003-device_id-handle-wwid-with-spaces-or-control-charact.patch
BuildRequires: make
BuildRequires: gcc
@ -115,6 +117,8 @@ or more physical volumes and creating one or more logical volumes
%prep
%setup -q -n LVM2.%{version}
%patch1 -p1 -b .backup1
%patch2 -p1 -b .backup2
%patch3 -p1 -b .backup3
%build
%global _default_pid_dir /run
@ -686,6 +690,9 @@ An extensive functional testsuite for LVM2.
%endif
%changelog
* Fri Nov 19 2021 Marian Csontos <mcsontos@redhat.com> - 2.03.14-3
- Fix gating tests.
* Thu Nov 18 2021 Marian Csontos <mcsontos@redhat.com> - 2.03.14-2
- Change use_devices_file default back to 1.