diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..85ddd1b6df69d0e342203033b0e9ba139643bfc9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tgz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..dad12cd642447dc78dfe8842fbebe29a33ad8c7a --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/lvm2 diff --git a/0005-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch b/0005-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch deleted file mode 100644 index 4548a3657a7f159f9fb809252b8d2598002c6c16..0000000000000000000000000000000000000000 --- a/0005-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/tools/command.c b/tools/command.c -index 50791b1..3270b26 100644 ---- a/tools/command.c -+++ b/tools/command.c -@@ -1375,7 +1375,7 @@ static int _copy_line(char *line, int max_line, int *position) - - memset(line, 0, max_line); - -- while (1) { -+ while ( p < strlen(_command_input) ) { - line[i] = _command_input[p]; - i++; - p++; diff --git a/0007-enhancement-add-dfx-log.patch b/0007-enhancement-add-dfx-log.patch index 190770a764c01f3af560c9774301dd863b0b870b..ed422c8d2980a0b8b278b97e4642e861962a249e 100644 --- a/0007-enhancement-add-dfx-log.patch +++ b/0007-enhancement-add-dfx-log.patch @@ -185,10 +185,10 @@ index b5f05f2..fc5d589 100644 #define _LOG_BYPASS_REPORT 0x0200 /* do not log through report even if report available */ +#define _LOG_IMPORTANT_TO_SYSLOG 0x10000 /*log to syslog even if loglevel number is bigger than _debug_level configuration, + unless _debug_level is 0*/ - #define log_level(x) ((x) & 0x0f) /* obtain message level */ + #define log_level(x) ((x) & 0x07) /* obtain message level */ #define log_stderr(x) ((x) & _LOG_STDERR) /* obtain stderr bit */ #define log_once(x) ((x) & _LOG_ONCE) /* obtain once bit */ -@@ -111,7 +113,7 @@ +@@ -110,7 +112,7 @@ #define log_very_verbose(args...) log_info(args) #define log_verbose(args...) log_notice(args) #define log_print(args...) LOG_LINE(_LOG_WARN, args) diff --git a/0011-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch b/0011-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch index 09cab73ff726ba0d19ed5f60d35f7b77b8ef4a6f..e4daf13545a0b0e22a68dd27efae068e85147ba4 100644 --- a/0011-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch +++ b/0011-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch @@ -25,7 +25,7 @@ index dca00bc..0ca0d57 100644 +ENV{DM_NAME}=="?*", SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" - ENV{DM_SUSPENDED}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_import" + ENV{DISKSEQ}=="?*", SYMLINK+="disk/by-diskseq/$env{DISKSEQ}" -- 2.33.0 diff --git a/0013-udev-repeat.patch b/0013-udev-repeat.patch index 176efda65772b429ba93e8466557264133848777..cedc922b1c1a03d4c163b87fa6012bae63b87586 100644 --- a/0013-udev-repeat.patch +++ b/0013-udev-repeat.patch @@ -22,15 +22,16 @@ 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 +@@ -62,6 +62,8 @@ ACTION!="add|change", GOTO="dm_end" # 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}!="?*", GOTO="dm_no_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" + + # Store the original flag from the cookie as DM_COOKIE_DISABLE_OTHER_RULES_FLAG + # in the udev db. DM_UDEV_DISABLE_OTHER_RULES_FLAG will be or'd with other + 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 diff --git a/0014-use-sync-io-read-bcache-by-defaults.patch b/0014-use-sync-io-read-bcache-by-defaults.patch index 8017062090bc98b3b3d6a2c93212b4ab17a3a7e3..d4f92b0c41424c9af5edadd281d4dddce800db89 100644 --- a/0014-use-sync-io-read-bcache-by-defaults.patch +++ b/0014-use-sync-io-read-bcache-by-defaults.patch @@ -25,7 +25,7 @@ index faf628f..d039cc7 100644 +#define DEFAULT_USE_AIO 0 #define DEFAULT_SANLOCK_LV_EXTEND_MB 256 - + #define DEFAULT_SANLOCK_ALIGN_SIZE 8 /* in MiB, applies to 4K disks only */ -- 2.33.0 diff --git a/0015-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch b/0015-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch deleted file mode 100644 index 0cdf96ed463dfc36e7bf5c8828c091605ff5f8b8..0000000000000000000000000000000000000000 --- a/0015-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 65d23a1d75013f328e9a3a1914484514621822ef Mon Sep 17 00:00:00 2001 -From: wangzhiqiang -Date: Wed, 30 Aug 2023 15:47:42 -0500 -Subject: [PATCH] vgchange: acquire an exclusive VG lock for refresh - -Concurrent vgchange --refresh commands can lead to hung -tasks in dm code. - -Signed-off-by: wangzhiqiang ---- - tools/vgchange.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tools/vgchange.c b/tools/vgchange.c -index e2d3dad02..8c1d605c6 100644 ---- a/tools/vgchange.c -+++ b/tools/vgchange.c -@@ -1008,7 +1008,8 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv) - - if (update) - flags |= READ_FOR_UPDATE; -- else if (arg_is_set(cmd, activate_ARG)) -+ else if (arg_is_set(cmd, activate_ARG) || -+ arg_is_set(cmd, refresh_ARG)) - flags |= READ_FOR_ACTIVATE; - - if (!(handle = init_processing_handle(cmd, NULL))) { --- -2.33.0 - diff --git a/0016-dm-event-release-buffer-on-dm_event_get_version.patch b/0016-dm-event-release-buffer-on-dm_event_get_version.patch deleted file mode 100644 index 3e26c0d397ce8b9dede85af7f1a6d0b1af65cfac..0000000000000000000000000000000000000000 --- a/0016-dm-event-release-buffer-on-dm_event_get_version.patch +++ /dev/null @@ -1,45 +0,0 @@ -From a203499ba32aabec0e8a9002517e1608e4e83b2c Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Mon, 25 Sep 2023 11:47:40 +0200 -Subject: [PATCH] dm-event: release buffer on dm_event_get_version - -Avoid memory leak in this function. ---- - daemons/dmeventd/libdevmapper-event.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c -index 9e4dd2469..0aabc03e6 100644 ---- a/daemons/dmeventd/libdevmapper-event.c -+++ b/daemons/dmeventd/libdevmapper-event.c -@@ -844,6 +844,7 @@ int dm_event_get_registered_device(struct dm_event_handler *dmevh, int next) - int dm_event_get_version(struct dm_event_fifos *fifos, int *version) { - char *p; - struct dm_event_daemon_message msg = { 0 }; -+ int ret = 0; - - if (daemon_talk(fifos, &msg, DM_EVENT_CMD_HELLO, NULL, NULL, 0, 0)) - return 0; -@@ -851,13 +852,17 @@ int dm_event_get_version(struct dm_event_fifos *fifos, int *version) { - *version = 0; - - if (!p || !(p = strchr(p, ' '))) /* Message ID */ -- return 0; -+ goto out; - if (!(p = strchr(p + 1, ' '))) /* HELLO */ -- return 0; -+ goto out; - if ((p = strchr(p + 1, ' '))) /* HELLO, once more */ - *version = atoi(p); - -- return 1; -+ ret = 1; -+out: -+ free(msg.data); -+ -+ return ret; - } - - void dm_event_log_set(int debug_log_level, int use_syslog) --- -2.39.3 \ No newline at end of file diff --git a/0017-clean-up-group-struct-in-_stats_create_group-error-path.patch b/0017-clean-up-group-struct-in-_stats_create_group-error-path.patch deleted file mode 100644 index 010172fbc8e58747bd5a9fdb4b95af518a945879..0000000000000000000000000000000000000000 --- a/0017-clean-up-group-struct-in-_stats_create_group-error-path.patch +++ /dev/null @@ -1,43 +0,0 @@ -From eda99fc3839dcd439270ba5977ca6628bd9752cc Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Thu, 31 Aug 2023 16:59:02 +0100 -Subject: [PATCH] Clean up group struct in _stats_create_group() error path - -Conflict: NA -Reference: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=eda99fc3839dcd439270ba5977ca6628bd9752cc - -Fix a double free in the error path from _stats_create_group() by -clearing the group struct embedded in the dm_stats handle before -returning: - - device-mapper: message ioctl on (253:0) failed: Invalid argument - Could not create regions from file /var/tmp/File With Spaces. - free(): double free detected in tcache 2 - Aborted (core dumped) ---- - libdm/libdm-stats.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c -index 62b28b69d..dc2907f4e 100644 ---- a/libdm/libdm-stats.c -+++ b/libdm/libdm-stats.c -@@ -3908,9 +3908,14 @@ static int _stats_create_group(struct dm_stats *dms, dm_bitset_t regions, - - /* force an update of the group tag stored in aux_data */ - if (!_stats_set_aux(dms, *group_id, dms->regions[*group_id].aux_data)) -- return 0; -+ goto bad; - - return 1; -+bad: -+ group->group_id = DM_STATS_GROUP_NOT_PRESENT; -+ group->regions = NULL; -+ dm_free((char *) group->alias); -+ return 0; - } - - static int _stats_group_check_overlap(const struct dm_stats *dms, --- -2.39.3 - diff --git a/0018-do-not-pass-empty-string-in-callback.patch b/0018-do-not-pass-empty-string-in-callback.patch deleted file mode 100644 index 4ef293aa02032da01c0f259bce7029c86af16c1b..0000000000000000000000000000000000000000 --- a/0018-do-not-pass-empty-string-in-callback.patch +++ /dev/null @@ -1,29 +0,0 @@ -From e022805f1d908cd9da8701db99a8e8ffd97c5519 Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Tue, 4 Jul 2023 22:46:50 +0200 -Subject: [PATCH] pool: do not pass empty string in callback - -When preparing cmdline to executing dmpd tool, avoid adding -empty string ("") on such line. - ---- - lib/activate/dev_manager.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c -index 07d5873..469d71f 100644 ---- a/lib/activate/dev_manager.c -+++ b/lib/activate/dev_manager.c -@@ -2529,7 +2529,8 @@ static int _pool_callback(struct dm_tree_node *node, - data->global); - return 0; - } -- argv[++args] = cv->v.str; -+ if (cv->v.str[0]) -+ argv[++args] = cv->v.str; - } - - if (args == 16) { --- -2.27.0 - diff --git a/0019-fix-memleak-in-vgchange.patch b/0019-fix-memleak-in-vgchange.patch deleted file mode 100644 index b5703e4270982b4fb774d66ce31308268f39a595..0000000000000000000000000000000000000000 --- a/0019-fix-memleak-in-vgchange.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 7ec97ed5f2b95585eb1538ee6edeedb7275101eb Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Wed, 12 Jul 2023 14:15:41 +0200 -Subject: [PATCH] cov: fix memleak in vgchange - -Release allocated vgname from get_single_vgname_cmd_arg() -when it is not returned via *vgname_ret. - ---- - tools/vgchange.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tools/vgchange.c b/tools/vgchange.c -index 63861b5..7a53a7f 100644 ---- a/tools/vgchange.c -+++ b/tools/vgchange.c -@@ -863,6 +863,8 @@ static int _vgchange_autoactivation_setup(struct cmd_context *cmd, - *flags &= ~READ_WITHOUT_LOCK; - cmd->can_use_one_scan = 0; - } -+ -+ free(vgname); - return 1; - - } --- -2.27.0 - diff --git a/0020-udev-create-dev-disk-by-label-symlinks-for-DM-devs-t.patch b/0020-udev-create-dev-disk-by-label-symlinks-for-DM-devs-t.patch deleted file mode 100644 index 1d90e376573990fc6c873888290e19f05792a9af..0000000000000000000000000000000000000000 --- a/0020-udev-create-dev-disk-by-label-symlinks-for-DM-devs-t.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f09a9927207f81b33b9eee8ac5660d90e695dad1 Mon Sep 17 00:00:00 2001 -From: Peter Rajnoha -Date: Mon, 25 Mar 2024 10:16:04 +0100 -Subject: [PATCH] udev: create /dev/disk/by-label symlinks for DM devs that - have crypto as next layer - -We already create /dev/disk/by-uuid symlinks for DM devices which -contain crypto-type as next layer (as identified by blkid). - -Also create /dev/disk/by-label symlinks as the labels can be -defined for crypto-type devices too. - -Reported and fix suggested by: Patrick Plenefisch -See also: -https://lore.kernel.org/lvm-devel/CAOCpoWfYjOVNJNt+cnOVXDHiDq2wRogTqBijcUoa7chqOLRa5Q@mail.gmail.com/ ---- - udev/13-dm-disk.rules.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletion(-) - -diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in -index 496dd06c5..b53bb62de 100644 ---- a/udev/13-dm-disk.rules.in -+++ b/udev/13-dm-disk.rules.in -@@ -38,7 +38,7 @@ IMPORT{db}="ID_PART_GPT_AUTO_ROOT" - LABEL="dm_link" - ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" - ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" --ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}" - ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}" - ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_GPT_AUTO_ROOT}=="1", SYMLINK+="gpt-auto-root" --- -2.33.0 - diff --git a/0021-lvmcache-fix-memleaks-on-list-removal.patch b/0021-lvmcache-fix-memleaks-on-list-removal.patch deleted file mode 100644 index bc18eff5b390d11941cdad049ba52a46ccf70a8f..0000000000000000000000000000000000000000 --- a/0021-lvmcache-fix-memleaks-on-list-removal.patch +++ /dev/null @@ -1,70 +0,0 @@ -From f59ec61fa79001bd440d0bec32a59971efa2d032 Mon Sep 17 00:00:00 2001 -From: David Teigland -Date: Wed, 3 Apr 2024 17:54:48 -0500 -Subject: [PATCH] lvmcache: fix memleaks on list removal -Reference:https://github.com/lvmteam/lvm2/commit/f59ec61fa79001bd440d0bec32a59971efa2d032 - ---- - lib/cache/lvmcache.c | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c -index b8a9eac..2315d8e 100644 ---- a/lib/cache/lvmcache.c -+++ b/lib/cache/lvmcache.c -@@ -912,8 +912,10 @@ next: - } - - /* Remove dev_mpath from altdevs. */ -- if ((devl = device_list_find_dev(&altdevs, dev_mpath))) -+ if ((devl = device_list_find_dev(&altdevs, dev_mpath))) { - dm_list_del(&devl->list); -+ free(devl); -+ } - - /* Remove info from lvmcache that came from the component dev. */ - log_debug("Ignoring multipath component %s with PVID %s (dropping info)", dev_name(dev_drop), pvid); -@@ -950,6 +952,7 @@ next: - - log_debug("Ignoring multipath component %s with PVID %s (dropping duplicate)", dev_name(dev_drop), pvid); - dm_list_del(&devl->list); -+ free(devl); - - cmd->filter->wipe(cmd, cmd->filter, dev_drop, NULL); - dev_drop->flags &= ~DEV_SCAN_FOUND_LABEL; -@@ -979,8 +982,10 @@ next: - } - - /* Remove dev_md from altdevs. */ -- if ((devl = device_list_find_dev(&altdevs, dev_md))) -+ if ((devl = device_list_find_dev(&altdevs, dev_md))) { - dm_list_del(&devl->list); -+ free(devl); -+ } - - /* Remove info from lvmcache that came from the component dev. */ - log_debug("Ignoring md component %s with PVID %s (dropping info)", dev_name(dev_drop), pvid); -@@ -1007,8 +1012,10 @@ next: - } - - /* Remove dev_md from altdevs. */ -- if ((devl = device_list_find_dev(&altdevs, dev_md))) -- dm_list_del(&devl->list); -+ if ((devl = device_list_find_dev(&altdevs, dev_md))) { -+ dm_list_del(&devl->list); -+ free(devl); -+ } - } - - if (info && !dev_md) { -@@ -1036,6 +1043,7 @@ next: - - log_debug("Ignoring md component %s with PVID %s (dropping duplicate)", dev_name(dev_drop), pvid); - dm_list_del(&devl->list); -+ free(devl); - - cmd->filter->wipe(cmd, cmd->filter, dev_drop, NULL); - dev_drop->flags &= ~DEV_SCAN_FOUND_LABEL; --- -2.27.0 - diff --git a/0022-dmstats-Fix-memory-leak-on-error-path.patch b/0022-dmstats-Fix-memory-leak-on-error-path.patch deleted file mode 100644 index 2962fc95c2823a5ab175bd5606492c5ad158e6ed..0000000000000000000000000000000000000000 --- a/0022-dmstats-Fix-memory-leak-on-error-path.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d1f0b89e65fd8817930bbf89051fe03efb0a1db5 Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Tue, 28 Nov 2023 21:41:35 +0100 -Subject: [PATCH] dmstats: Fix memory leak on error path - ---- - libdm/libdm-stats.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c -index dc2907f..62be5de 100644 ---- a/libdm/libdm-stats.c -+++ b/libdm/libdm-stats.c -@@ -1970,7 +1970,7 @@ static int _stats_create_region(struct dm_stats *dms, uint64_t *region_id, - (strlen(hist_arg)) ? HISTOGRAM_ARG : "", - hist_arg)) < 0) { - log_error(err_fmt, PRECISE_ARG " option."); -- return 0; -+ goto out; - } - } else - opt_args = dm_strdup(""); --- -2.27.0 - diff --git a/0023-fix-function-undeclared-in-libdm-common.c-and-dev-cache.c.patch b/0023-fix-function-undeclared-in-libdm-common.c-and-dev-cache.c.patch deleted file mode 100644 index 3df987f2d2a2e69ec8acc88305b0c8704ed9f2d4..0000000000000000000000000000000000000000 --- a/0023-fix-function-undeclared-in-libdm-common.c-and-dev-cache.c.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e5ce6e143393fe50da73eabdf32ce3dafb7b9dd7 Mon Sep 17 00:00:00 2001 -From: yuncang123 <1050706328@qq.com> -Date: Sat, 7 Sep 2024 18:34:09 +0800 -Subject: [PATCH] fix function undeclared in libdm-common.c and dev-cache.c - ---- - lib/device/dev-cache.c | 1 + - libdm/libdm-common.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c -index 85f9b49..ee39814 100644 ---- a/lib/device/dev-cache.c -+++ b/lib/device/dev-cache.c -@@ -31,6 +31,7 @@ - #include - /* coverity[unnecessary_header] needed for MuslC */ - #include -+#include - - struct dev_iter { - struct btree_iter *current; -diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c -index 734a012..177dc40 100644 ---- a/libdm/libdm-common.c -+++ b/libdm/libdm-common.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #ifdef UDEV_SYNC_SUPPORT - # include --- -2.43.0 - diff --git a/0024-config-check-for-0-from-read.patch b/0024-config-check-for-0-from-read.patch deleted file mode 100644 index ad708c19270754ce4ff0b5e830edb95af4fffbf3..0000000000000000000000000000000000000000 --- a/0024-config-check-for-0-from-read.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 713310b93d85ffd01aae26f3d878a8b0453fa506 Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Wed, 29 Jan 2025 00:00:23 +0100 -Subject: [PATCH] config: check for 0 from read - -When the read returns 0, it could mean the file -was trimmed or some other type of problem. -In this case abort the potentially endless loop. - -Reference: https://github.com/lvmteam/lvm2/commit/e907c3cf9a1c294b6551d525d58f2bd7dbbb1cc5 -Conflict: NA ---- - lib/config/config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/config/config.c b/lib/config/config.c -index 5986e64..02c757e 100644 ---- a/lib/config/config.c -+++ b/lib/config/config.c -@@ -536,7 +536,7 @@ int config_file_read_fd(struct dm_config_tree *cft, struct device *dev, dev_io_r - sz = read(dev_fd(dev), buf + rsize, size - rsize); - } while ((sz < 0) && ((errno == EINTR) || (errno == EAGAIN))); - -- if (sz < 0) { -+ if (sz <= 0) { - log_sys_error("read", dev_name(dev)); - goto out; - } --- -2.33.0 - diff --git a/0025-fix-multiple-mounts-in-lvextend.patch b/0025-fix-multiple-mounts-in-lvextend.patch deleted file mode 100644 index 888d318628f75656636da8a45423c939f5141a5c..0000000000000000000000000000000000000000 --- a/0025-fix-multiple-mounts-in-lvextend.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 7c3eca833ff7878d6d32198ed76380c91fdc15fc Mon Sep 17 00:00:00 2001 -From: David Teigland -Date: Fri, 16 Jun 2023 12:06:40 -0500 -Subject: [PATCH] lvresize: fix multiple mounts - -which was mistaken as a mounted LV that had been renamed. ---- - lib/device/filesystem.c | 47 +++++++++++++++++++++-------------------- - 1 file changed, 24 insertions(+), 23 deletions(-) - -diff --git a/lib/device/filesystem.c b/lib/device/filesystem.c -index 2572bca69..39e563117 100644 ---- a/lib/device/filesystem.c -+++ b/lib/device/filesystem.c -@@ -243,8 +243,6 @@ int fs_mount_state_is_misnamed(struct cmd_context *cmd, struct logical_volume *l - FILE *fme = NULL; - struct mntent *me; - int renamed = 0; -- int found_dir = 0; -- int found_dev = 0; - int dev_match, dir_match; - - if (stat(lv_path, &st_lv) < 0) { -@@ -281,6 +279,9 @@ int fs_mount_state_is_misnamed(struct cmd_context *cmd, struct logical_volume *l - } - endmntent(fme); - -+ if (mtab_mntpath[0]) -+ log_debug("%s mtab mntpath %s", display_lvname(lv), mtab_mntpath); -+ - /* - * In mtab dir path, replace each ascii space character with the - * four characters \040 which is how /proc/mounts represents spaces. -@@ -319,15 +320,31 @@ int fs_mount_state_is_misnamed(struct cmd_context *cmd, struct logical_volume *l - if (strcmp(fstype, proc_fstype)) - continue; - -+ /* -+ * When an LV is mounted on two dirs, it appears in /proc/mounts twice as -+ * /dev/mapper/vg-lvol0 on /foo type xfs ... -+ * /dev/mapper/vg-lvol0 on /bar type xfs ... -+ * All entries match dm_devpath, one entry matches mntpath, -+ * and other entries don't match mntpath. -+ * -+ * When an LV is mounted on one dir, and is renamed from lvol0 to lvol1, -+ * it appears in /proc/mounts once as -+ * /dev/mapper/vg-lvol0 on /foo type xfs ... -+ */ -+ - dir_match = !strcmp(mtab_mntpath, proc_mntpath); - dev_match = !strcmp(dm_devpath, proc_devpath); - -- if (dir_match) -- found_dir++; -- if (dev_match) -- found_dev++; -+ if (!dir_match && !dev_match) -+ continue; -+ -+ if (dev_match && !dir_match) { -+ log_debug("LV %s mounted at %s also mounted at %s.", -+ dm_devpath, mtab_mntpath, proc_mntpath); -+ continue; -+ } - -- if (dir_match != dev_match) { -+ if (!dev_match && dir_match) { - log_error("LV %s mounted at %s may have been renamed (from %s).", - dm_devpath, proc_mntpath, proc_devpath); - renamed = 1; -@@ -337,26 +354,10 @@ int fs_mount_state_is_misnamed(struct cmd_context *cmd, struct logical_volume *l - if (fclose(fp)) - stack; - -- /* -- * Don't try resizing if: -- * - different device names apppear for the mount point -- * (LVs probably renamed while mounted), or -- * - the mount point for the LV appears multiple times, or -- * - the LV device is listed for multiple mounts. -- */ - if (renamed) { - log_error("File system resizing not supported: fs utilities do not support renamed devices."); - return 1; - } -- /* These two are likely detected as renamed, but include checks in case. */ -- if (found_dir > 1) { -- log_error("File system resizing not supported: %s appears more than once in /proc/mounts.", mtab_mntpath); -- return 1; -- } -- if (found_dev > 1) { -- log_error("File system resizing not supported: %s appears more than once in /proc/mounts.", dm_devpath); -- return 1; -- } - return 0; - } - diff --git a/LVM2.2.03.21.tgz b/LVM2.2.03.21.tgz deleted file mode 100644 index f054bbed3e8917c476237f73ec623d6821e3416f..0000000000000000000000000000000000000000 Binary files a/LVM2.2.03.21.tgz and /dev/null differ diff --git a/LVM2.2.03.36.tgz b/LVM2.2.03.36.tgz new file mode 100644 index 0000000000000000000000000000000000000000..b63e0d1ed0564ecb20a5d4abf15bdb4045db8e9c --- /dev/null +++ b/LVM2.2.03.36.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44db12df4b990ed2c910176279f70b257f79ee6fc7684c577afbf59c13cd2cca +size 2948884 diff --git a/lvm2.spec b/lvm2.spec index 9646c97f84a079e40c4d3d7c79cd6f629a2cc0bc..a3115958b9f7d2eb79edc4e64a29aafc83a3a893 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -12,13 +12,8 @@ %global use_lockd_sanlock 0 %endif -%if %{use_cluster} - %global configure_cluster --with-cluster=internal --with-clvmd=corosync - %if %{use_cmirror} - %global configure_cmirror --enable-cmirrord - %endif -%else - %global configure_cluster --with-cluster=internal --with-clvmd=none +%if %{use_cmirror} + %global configure_cmirror --enable-cmirrord %endif %if %{use_lockd_dlm} @@ -32,7 +27,7 @@ %global libselinux_version 1.30.19-4 %global persistent_data_version 0.7.0-0.1.rc6 %global sanlock_version 3.3.0-2 -%global device_mapper_version 1.02.195 +%global device_mapper_version 1.02.210 %global systemd_version 189-3 %global dracut_version 002-18 %global util_linux_version 2.24 @@ -42,18 +37,17 @@ %global dlm_version 4.0.6-2 Name: lvm2 -Version: 2.03.21 -Release: 16 +Version: 2.03.36 +Release: 1 Epoch: 8 Summary: Tools for logical volume management -License: GPLv2+ and LGPLv2.1 and BSD -URL: http://sourceware.org/lvm2 -Source0: https://sourceware.org/pub/lvm2/releases/LVM2.2.03.21.tgz +License: GPL-2.0-only +URL: https://sourceware.org/lvm2 +Source0: https://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz Patch1: 0001-lvm2-set-default-preferred_names.patch Patch2: 0002-lvm2-default-allow-changes-with-duplicate-pvs.patch Patch3: 0003-bugfix-lvm2-add-SSD.patch Patch4: 0004-bugfix-add-timeout-when-fail-to-wait-udev.patch -Patch5: 0005-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch Patch6: 0006-enhancement-modify-default-log-level-to-error-level.patch Patch7: 0007-enhancement-add-dfx-log.patch Patch8: 0008-enhancement-syslog-more-when-use-libdevmapper-so.patch @@ -63,17 +57,6 @@ 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 -Patch15: 0015-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch -Patch16: 0016-dm-event-release-buffer-on-dm_event_get_version.patch -Patch17: 0017-clean-up-group-struct-in-_stats_create_group-error-path.patch -Patch18: 0018-do-not-pass-empty-string-in-callback.patch -Patch19: 0019-fix-memleak-in-vgchange.patch -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-config-check-for-0-from-read.patch -Patch25: 0025-fix-multiple-mounts-in-lvextend.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -106,11 +89,9 @@ BuildRequires: sanlock-devel >= %{sanlock_version} Requires: bash >= %{bash_version} Requires: module-init-tools Requires: device-mapper-persistent-data >= %{persistent_data_version} -Requires: device-mapper-event = %{?epoch}:%{device_mapper_version}-%{release} +Requires: device-mapper-event = %{epoch}:%{device_mapper_version}-%{release} Recommends: %{name}-help = %{epoch}:%{version}-%{release} -Requires(post): systemd-units >= %{systemd_version}, systemd-sysv -Requires(preun): systemd-units >= %{systemd_version} -Requires(postun): systemd-units >= %{systemd_version} +%{?systemd_requires} Provides: %{name}-libs Obsoletes: %{name}-libs @@ -120,34 +101,27 @@ lvm2 refers to the userspace toolset that provide logical volume management faci %package devel Summary: lvm2 devel files -License: LGPLv2 -Requires: %{name} = %{?epoch}:%{version}-%{release} -Requires: pkgconfig -Requires: device-mapper = %{?epoch}:%{device_mapper_version}-%{release} -Provides: device-mapper-devel = %{?epoch}:%{device_mapper_version}-%{release} +License: LGPL-2.1-only +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} +Provides: device-mapper-devel = %{epoch}:%{device_mapper_version}-%{release} Obsoletes: device-mapper-devel -Provides: device-mapper-event-devel = %{?epoch}:%{device_mapper_version}-%{release} +Provides: device-mapper-event-devel = %{epoch}:%{device_mapper_version}-%{release} Obsoletes: device-mapper-event-devel %description devel This package contains all include files, libraries files needed to develop programs that use lvm2. -%package help -Summary: Including man files for lvm2 -Requires: man -BuildArch: noarch - -%description help -This contains man files for the using of lvm2. +%package_help %package -n python3-lvm-deprecated Summary: Python 3 api to lvm -License: LGPLv2 -Provides: python3-lvm = %{?epoch}:%{version}-%{release} +License: LGPL-2.1-only +Provides: python3-lvm = %{epoch}:%{version}-%{release} %{?python_provide:%python_provide python3-lvm} -Provides: %{name}-python3-libs = %{?epoch}:%{version}-%{release} -Obsoletes: %{name}-python3-libs < %{?epoch}:%{version}-%{release} -Requires: %{name}-libs = %{?epoch}:%{version}-%{release} +Provides: %{name}-python3-libs = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-python3-libs < %{epoch}:%{version}-%{release} +Requires: %{name}-libs = %{epoch}:%{version}-%{release} %description -n python3-lvm-deprecated Support python 3 to use lvm. @@ -155,16 +129,14 @@ Support python 3 to use lvm. %if %{use_lockd_dlm} || %{use_lockd_sanlock} %package lockd Summary: LVM locking daemon -Requires: lvm2 = %{?epoch}:%{version}-%{release} +Requires: lvm2 = %{epoch}:%{version}-%{release} %if %{use_lockd_sanlock} Requires: sanlock-lib >= %{sanlock_version} %endif %if %{use_lockd_dlm} Requires: dlm-lib >= %{dlm_version} %endif -Requires(post): systemd-units >= %{systemd_version} -Requires(preun): systemd-units >= %{systemd_version} -Requires(postun): systemd-units >= %{systemd_version} +%{?systemd_requires} %description lockd LVM commands use lvmlockd to coordinate access to shared storage. @@ -173,9 +145,9 @@ LVM commands use lvmlockd to coordinate access to shared storage. %if %{use_cluster} %package cluster Summary: cluster LVM daemon tools -License: GPLv2 -Requires: lvm2 = %{?epoch}:%{version}-%{release} -Requires(preun): device-mapper >= %{?epoch}:%{device_mapper_version} +License: GPL-2.0-only +Requires: lvm2 = %{epoch}:%{version}-%{release} +Requires(preun): device-mapper >= %{epoch}:%{device_mapper_version} Requires(preun): lvm2 >= 2.02 Requires: corosync >= %{corosync_version} Requires: dlm >= %{dlm_version} @@ -190,9 +162,9 @@ cluster distributes LVM metadata updates around a cluster. %if %{use_cluster} && %{use_cmirror} %package -n cmirror Summary: cluster mirror log daemon -License: GPLv2 +License: GPL-2.0-only Requires: corosync >= %{corosync_version} -Requires: device-mapper = %{?epoch}:%{device_mapper_version}-%{release} +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} Requires: resource-agents >= %{resource_agents_version} Provides: cmirror-standalone Obsoletes: cmirror-standalone @@ -203,22 +175,20 @@ cmirror tracks mirror log information in a cluster. %package dbusd Summary: LVM2 D-Bus daemon -License: GPLv2 -Requires: lvm2 >= %{?epoch}:%{version}-%{release} +License: GPL-2.0-only +Requires: lvm2 >= %{epoch}:%{version}-%{release} Requires: dbus Requires: python3-dbus Requires: python3-pyudev Requires: python3-gobject-base -Requires(post): systemd-units >= %{systemd_version} -Requires(preun): systemd-units >= %{systemd_version} -Requires(postun): systemd-units >= %{systemd_version} +%{?systemd_requires} %description dbusd dbusd is a service which provides a D-Bus API to the logical volume manager. %package test Summary: Testsuite for lvm2 -License: LGPLv2 and GPLv2 and BSD-2-Clause +License: GPL-2.0-only AND LGPL-2.1-only AND BSD-2-Clause Provides: %{name}-testsuite Obsoletes: %{name}-testsuite @@ -227,15 +197,16 @@ An extensive functional testsuite for LVM2. %prep %autosetup -n LVM2.%{version} -p1 +(grep %{version} VERSION) && (grep %{device_mapper_version} VERSION_DM) %package -n device-mapper Summary: Low level logical volume management Version: %{device_mapper_version} -License: LGPLv2 -URL: http://sources.redhat.com/dm +License: GPL-2.0-only +URL: https://sources.redhat.com/dm Requires: util-linux >= %{util_linux_version} Requires: systemd >= %{systemd_version} -Provides: device-mapper-libs = %{?epoch}:%{device_mapper_version}-%{release} +Provides: device-mapper-libs = %{epoch}:%{device_mapper_version}-%{release} Obsoletes: device-mapper-libs Conflicts: dracut < %{dracut_version} @@ -245,9 +216,9 @@ Manages logical devices that use the device-mapper driver. %package -n device-mapper-event Summary: Handle device-mapper events Version: %{device_mapper_version} -Requires: device-mapper = %{?epoch}:%{device_mapper_version}-%{release} +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} Requires: systemd-units -Provides: device-mapper-event-libs = %{?epoch}:%{device_mapper_version}-%{release} +Provides: device-mapper-event-libs = %{epoch}:%{device_mapper_version}-%{release} Obsoletes: device-mapper-event-libs %description -n device-mapper-event @@ -255,14 +226,42 @@ It contains tthe event monitoring daemon for device-mapper devices. Library plu can register and carryout actions triggered when particular events occur. %build -%configure --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm --with-default-pid-dir=/run --with-default-locking-dir=/run/lock/lvm --with-usrlibdir=%{_libdir} --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_cluster} %{?configure_cmirror} --with-udevdir=%{_prefix}/lib/udev/rules.d --enable-udev_sync --with-thin=internal --enable-lvmpolld %{?configure_lockd_dlm} %{?configure_lockd_sanlock} --enable-dbus-service --enable-notify-dbus --enable-dmfilemapd -make %{?_smp_mflags} +%configure \ + --with-default-dm-run-dir=/run \ + --with-default-run-dir=/run/lvm \ + --with-default-pid-dir=/run \ + --with-default-locking-dir=/run/lock/lvm \ + --with-usrlibdir=%{_libdir} \ + --enable-fsadm \ + --enable-write_install \ + --with-user= \ + --with-group= \ + --with-device-uid=0 \ + --with-device-gid=6 \ + --with-device-mode=0660 \ + --enable-pkgconfig \ + --enable-cmdlib \ + --enable-dmeventd \ + --enable-blkid_wiping \ + --with-vdo=internal --with-vdo-format=%{_bindir}/vdoformat \ + %{?configure_cmirror} \ + --with-udevdir=%{_prefix}/lib/udev/rules.d \ + --enable-udev_sync \ + --with-thin=internal \ + --enable-lvmpolld \ + %{?configure_lockd_dlm} \ + %{?configure_lockd_sanlock} \ + --enable-dbus-service \ + --enable-notify-dbus \ + --enable-dmfilemapd \ +%{nil} +%make_build %check make run-unit-test %install -make install DESTDIR=%{buildroot} +%make_install make install_system_dirs DESTDIR=%{buildroot} make install_systemd_units DESTDIR=%{buildroot} make install_systemd_generators DESTDIR=%{buildroot} @@ -270,7 +269,6 @@ make install_tmpfiles_configuration DESTDIR=%{buildroot} make -C test install DESTDIR=%{buildroot} %post -/sbin/ldconfig %systemd_post blk-availability.service lvm2-monitor.service if [ "$1" = "1" ] ; then systemctl enable lvm2-monitor.service @@ -288,16 +286,8 @@ systemctl start lvm2-lvmpolld.socket >/dev/null 2>&1 || : %postun %systemd_postun lvm2-monitor.service %systemd_postun_with_restart lvm2-lvmpolld.service -/sbin/ldconfig - -%post -n device-mapper -/sbin/ldconfig - -%postun -n device-mapper -/sbin/ldconfig %post -n device-mapper-event -/sbin/ldconfig %systemd_post dm-event.socket systemctl enable dm-event.socket systemctl start dm-event.socket >/dev/null 2>&1 || : @@ -308,9 +298,6 @@ fi %preun -n device-mapper-event %systemd_preun dm-event.service dm-event.socket -%postun -n device-mapper-event -/sbin/ldconfig - %if %{use_lockd_dlm} || %{use_lockd_sanlock} %post lockd %systemd_post lvmlockd.service lvmlocks.service @@ -366,6 +353,7 @@ fi %{_sbindir}/lvmconfig %{_sbindir}/lvmdump %{_sbindir}/lvmpolld +%{_sbindir}/lvmpersist %{_libdir}/liblvm2cmd.so.* %{_libdir}/libdevmapper-event-lvm2.so.* @@ -416,6 +404,8 @@ fi %{_unitdir}/lvm2-monitor.service %{_unitdir}/lvm2-lvmpolld.socket %{_unitdir}/lvm2-lvmpolld.service +%{_unitdir}/lvm-devices-import.service +%{_unitdir}/lvm-devices-import.path %files -n device-mapper %license COPYING COPYING.LIB @@ -500,6 +490,9 @@ fi %changelog +* Sun Oct 26 2025 Funda Wang - 8:2.03.36-1 +- update to 2.03.36 + * Thu Oct 09 2025 weishuaihao - 8:2.03.21-16 - Type:bugfix - ID:NA diff --git a/lvm2.yaml b/lvm2.yaml index 386b4d6988c3fcb4c2e2d93aeb36547fc642e525..763593dc0aa929db60378addee0cfb815fabca6d 100644 --- a/lvm2.yaml +++ b/lvm2.yaml @@ -1,4 +1,4 @@ version_control: git -src_repo: git://gitlab.com/lvmteam/lvm2 +src_repo: https://gitlab.com/lvmteam/lvm2.git tag_prefix: "^v" -seperator: "_" +separator: "_"