diff --git a/0013-udev-repeat.patch b/0013-udev-repeat.patch new file mode 100644 index 0000000000000000000000000000000000000000..176efda65772b429ba93e8466557264133848777 --- /dev/null +++ b/0013-udev-repeat.patch @@ -0,0 +1,49 @@ +From 69a3f4d986a4f5302a35771376a7785b9464889d Mon Sep 17 00:00:00 2001 +From: wuguanghao +Date: Sat, 9 Jun 2021 19:07:43 +0800 +Subject: [PATCH] udev repeat + +systemd-udev exec IMPORT{program} in rules to get stdout of +program for storing some ENV vars. However due to some reasons, +the stdout of program cannot be gotten by systemd-udevd, which +cause some errors due to missing of ENV vars. + +lv maybe lost after reboot, now we repeat to exec programs to +avoid lv missing. + +Signed-off-by: wuguanghao +Signed-off-by: Zhiqiang Liu +--- + udev/10-dm.rules.in | 2 ++ + udev/11-dm-lvm.rules.in | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in +index b4fa52a..3ed1242 100644 +--- a/udev/10-dm.rules.in ++++ b/udev/10-dm.rules.in +@@ -51,6 +51,8 @@ ACTION!="add|change", GOTO="dm_end" + # kernel version 2.6.31. Therefore, we can use this feature with + # kernels >= 2.6.31 only. Cookie is not decoded for remove event. + ENV{DM_COOKIE}=="?*", IMPORT{program}="(DM_EXEC)/dmsetup udevflags $env{DM_COOKIE}" ++ENV{DM_COOKIE}=="?*", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="?*", IMPORT{program}="(DM_EXEC)/dmsetup udevflags $env{DM_COOKIE}" ++ENV{DM_COOKIE}=="?*", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="?*", IMPORT{program}="(DM_EXEC)/dmsetup udevflags $env{DM_COOKIE}" + + # Rule out easy-to-detect inappropriate events first. + ENV{DISK_RO}=="1", GOTO="dm_disable" +diff --git a/udev/11-dm-lvm.rules.in b/udev/11-dm-lvm.rules.in +index 7c58994..33f7d1d 100644 +--- a/udev/11-dm-lvm.rules.in ++++ b/udev/11-dm-lvm.rules.in +@@ -19,6 +19,8 @@ ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end" + + # Use DM name and split it up into its VG/LV/layer constituents. + IMPORT{program}="(DM_EXEC)/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}" ++ENV{DM_VG_NAME}!="?*", IMPORT{program}="(DM_EXEC)/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}" ++ENV{DM_LV_NAME}!="?*", IMPORT{program}="(DM_EXEC)/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}" + + # DM_SUBSYSTEM_UDEV_FLAG0 is the 'NOSCAN' flag for LVM subsystem. + # This flag is used to temporarily disable selected rules to prevent any +-- +2.33.0 + diff --git a/0014-use-sync-io-read-bcache-by-defaults.patch b/0014-use-sync-io-read-bcache-by-defaults.patch new file mode 100644 index 0000000000000000000000000000000000000000..8017062090bc98b3b3d6a2c93212b4ab17a3a7e3 --- /dev/null +++ b/0014-use-sync-io-read-bcache-by-defaults.patch @@ -0,0 +1,31 @@ +From b36985754f67c3df89c42ed29250abf6dfaf7890 Mon Sep 17 00:00:00 2001 +From: Wu Guanghao +Date: Sat, 4 Jun 2022 03:06:52 +0400 +Subject: [PATCH] use sync io read bcache by defaults + +Currently lvm2 uses aio to read bcache by default, +but aio is created successfully but read fails, +resulting in lv creation failure. So use sync io +read bcache by default. + +Signed-off-by: Wu Guanghao +--- + lib/config/defaults.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/config/defaults.h b/lib/config/defaults.h +index faf628f..d039cc7 100644 +--- a/lib/config/defaults.h ++++ b/lib/config/defaults.h +@@ -70,7 +70,7 @@ + #define DEFAULT_METADATA_READ_ONLY 0 + #define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0 + #define DEFAULT_UNKNOWN_DEVICE_NAME "[unknown]" +-#define DEFAULT_USE_AIO 1 ++#define DEFAULT_USE_AIO 0 + + #define DEFAULT_SANLOCK_LV_EXTEND_MB 256 + +-- +2.33.0 + diff --git a/lvm2.spec b/lvm2.spec index 5893578ee24b2d4a89630c3e2430186ecaa36d33..4ae2d9a97ee2cbd42ed18a65d787a58330550d8e 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.18 -Release: 2 +Release: 3 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -61,6 +61,8 @@ Patch9: 0009-enhancement-log-it-when-disk-slow.patch Patch10: 0010-bugfix-lvm2-fix-the-reuse-of-va_list.patch Patch11: 0011-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch Patch12: 0012-lvm-code-reduce-cyclomatic-complexity.patch +Patch13: 0013-udev-repeat.patch +Patch14: 0014-use-sync-io-read-bcache-by-defaults.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -487,6 +489,9 @@ fi %changelog +* Thu Jun 8 2023 wangzhiqiang - 8:2.03.18-3 +- fix fail to create lv + * Fri Feb 10 2023 qiaobaoli1 - 8:2.03.18-2 - remove configure duplicate flag --with-thin