packages/utils/lvm2/patches/003-no-mallinfo.patch

46 lines
1.2 KiB
Diff
Raw Permalink Normal View History

--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
lvm2: update to version 2.03.31 and libdm version 1.02.205 Version 2.03.31 - 27th February 2025 ==================================== Reduce 'mandoc -T lint' reported issues for man pages. Restore support for LVM_SUPPRESS_FD_WARNINGS (2.03.24). Fix uncache and split cache restoring original state of volume. Extend use of lockopt skip to more scenarios. Enhance error path resolving in polling code. Disallow shared activation of LV with CoW snapshot. Fix lvmlockd use in lvremove of CoW snapshot, VDO pool, and uncache. Improve mirror split with opened temporary volumes. Improve pvmove finish with opened temporary volumes. Fix backup limit for devices file, handle over 10,000 files. Ignore reported optimal_io_size not divisible by 4096. Fix busy-loop in config reading when read returned 0. Fix DM cache preserving logic (2.03.28). Improve use of lvmlockd for usecases involving thin volumes and pools. Version 2.03.30 - 14th January 2025 =================================== Lvresize reports origin vdo volume cannot be resized. Support setting reserved_memory|stack of --config cmdline. Fix support for disabling memory locking (2.03.27). Do not extend an LV if FS resize unsupported and '--fs resize' used. Prevent leftover temporary device when converting in use volume to a pool. lvconvert detects early volume in use when converting it to a pool. Handle NVMe with quirk changed WWID not matching WWID in devices file. Version 2.03.29 - 09th December 2024 ==================================== Configure --enable/disable-sd-notify to control lvmlockd build with sd-notify. Allow test mode when lvmlockd is built without dlm support. Add a note about RAID + integrity synchronization to lvmraid(7) man page. Add a function for running lvconvert --repair on RAID LVs to lvmdbusd. Improve option section of man pages for listing commands ({pv,lv,vg}{s,display}). Fix renaming of raid sub LVs when converting a volume to raid (2.03.28). Fix segfault/VG write error for raid LV lvextend -i|--stripes -I|--stripesize. Revert ignore -i|--stripes, -I|--stripesize for lvextend on raid0 LV (2.03.27). Version 2.03.28 - 04th November 2024 ==================================== Use radix_tree to lookup for UUID within committed metadata. Use radix_tree to lookup LV list entry within VG struct. Introduce setting config/validate_metadata = full | none. Restore fs resize call for lvresize -r on the same size LV (2.03.17). Correct off-by-one devicesfile backup counting. Replace use of dm_hash with radix_tree for lv names and uuids. Refactor vg_validate with uniq_insert and better use of CPU caches. Add radix_tree_uniq_insert. Update DM cache when taking next VG lock instead of dropping it. Generate json string id only for json reporting. For vgsummary use new API call dm_config_parse_only_section(). Use radix_tree for PV names mapping. Split check_lv_segment into separate _in/complete_vg variant. Use find_lv instead of find_lv_in_vg when possible. Do a mirror fixup only when mirrors with logs are imported. Add faster crc32 calculation from zlib code for x86_64. Fall back to direct zeroing if BLKZEROOUT fails during new LV initialization. Version 2.03.27 - 02nd October 2024 =================================== Fix swap device size detection using blkid for lvresize/lvreduce/lvextend. Detect GPT partition table and pass partition filter if no partitions defined. Add global/sanlock_align_size option to configure sanlock lease size. Disable mem locking when activation/reserved_stack or reserved_memory is 0. Fix locking issues in lvmlockd leaving thin pool locked. Deprecate vdo settings vdo_write_policy and vdo_write_policy. Lots of typo fixes across lvm2 code base (codespell). Corrected integrity parameter interleave_sectors for DM table line. Ignore -i|--stripes, -I|--stripesize for lvextend on raid0 LV, like raid10. Do not accept duplicate device names for pvcreate. Version 2.03.26 - 23rd August 2024 ================================== Fix internal error reported by pvmove on a VG with single PV. Also accept --mknodes --refresh for vgscan. Fix vgmknodes --refresh to wait for udev before checking /dev content. Use log/report_command_log=1 config setting by default for JSON output format. Fix unreleased memory pools on RAID lvextend. Add --integritysettings option to manipulate dm-integrity settings. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-04-26 11:39:56 +08:00
@@ -199,12 +199,15 @@ static void _allocate_memory(void)
lvm2: update to version 2.03.35 and libdm 1.02.199 Version 2.03.25 - 12nd July 2024 ================================ Utilize more radix_tree instead of dm_hash and btree. Refactor DM uuid caching from device_mapper directory. Enhance checking for DM uuid device. Fix lvm shell command completion on tab key (2.03.24). Avoid lockd_vg call to lvmlockd for local VGs. Allow forced change of locktype from none. Handle OPTIONS defined in /etc/sysconfig/lvmlockd. Version 2.03.24 - 16th May 2024 =============================== Lvconvert supports VDO options for thin-pool with vdo conversion. Improve placement to .data.rel.ro and .rodata sections. Fix support for -y and -W when creating thinpool with vdo. Bettter support for runtime valgrind detection. Allow command interruption when communicating with dmeventd. Fix resize of VDO volume used for thin pool data volume. Use -Wl,-z,now and -Wl,--as-needed for compilation by default. Require 3.7 as minimal version for sanlock. Share code for closing opened desriptors on program startup. Fix memleak in lvmcache. Add configure --with-default-event-activation=ON setting. Fix return value from reporter function when hitting internal error. Skip checking of pools for lvremove and vgremove commands. VDO modprobes dm-vdo for 6.9 kernel and kvdo for older kernel version. Fix lvs reporting for VDO volumes with new upstream kernel driver. Don't import DM_UDEV_DISABLE_OTHER_RULES_FLAG in LVM rules, DM rules cover it. Fix table line generation for cache snapshots using cachevol. Enhance lvconvert support for external origins stacking. When swapping LV names also swap properties like hostname, time and data. Fix removal of stacked external origins. Lock filesystem when converting volume to read-only external origin. Support external origin between different thin-pool. Improve validation of acceptable volumes for external origins. Reduce amount of preloaded devices for complex device trees. Avoid logging problems from monitoring snapshots with inactive origins. Check for cache policy module presence in kernel's builtin modules file. Add configure --with-modulesdir to select kernel modules directory. Support creation of thin-pool with VDO use for its data volume. libdm: Version 1.02.199 - 12nd July 2024 ================================= Version 1.02.198 - 16th May 2024 ================================ Fix static only compilation of libdevmapper.a and dmsetup tool. Use better code for closing opened descriptors when starting dmeventd. Correct dmeventd -R for systemd environment. Restart of dmeventd -R checks pid file to detect running dmeventd first. Query with dmeventd -i quickly ends when there is no running dmeventd. Enhance dm_get_status_raid to handle mismatching status or reported legs. Create /dev/disk/by-label symlinks for DM devs that have crypto as next layer. Persist udev db for DM devs on cleanup used in initrd to rootfs transition. Process synthetic udev events other than 'add/change' as 'change' events. Increase DM_UDEV_RULES_VSN to 3 to indicate changed udev rules. Rename DM_NOSCAN to .DM_NOSCAN so it's not stored in udev db. Rename DM_SUSPENDED to .DM_SUSPENDED so it's not stored in udev db. Do not import DM_UDEV_DISABLE_OTHER_RULES_FLAG from db in 10-dm-disk.rules. Test DISK_RO after importing properties from db in 10-dm.rules. Also import ID_FS_TYPE in 13-dm-disk.rules from db if needed. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-08-02 04:00:00 +08:00
* memory on free(), this is good enough for our purposes.
*/
while (missing > 0) {
+#ifdef __GLIBC__
struct MALLINFO inf = MALLINFO();
hblks = inf.hblks;
+#endif
if ((areas[area] = malloc(_size_malloc_tmp)))
_touch_memory(areas[area], _size_malloc_tmp);
+#ifdef __GLIBC__
inf = MALLINFO();
if (hblks < inf.hblks) {
lvm2: update to version 2.03.31 and libdm version 1.02.205 Version 2.03.31 - 27th February 2025 ==================================== Reduce 'mandoc -T lint' reported issues for man pages. Restore support for LVM_SUPPRESS_FD_WARNINGS (2.03.24). Fix uncache and split cache restoring original state of volume. Extend use of lockopt skip to more scenarios. Enhance error path resolving in polling code. Disallow shared activation of LV with CoW snapshot. Fix lvmlockd use in lvremove of CoW snapshot, VDO pool, and uncache. Improve mirror split with opened temporary volumes. Improve pvmove finish with opened temporary volumes. Fix backup limit for devices file, handle over 10,000 files. Ignore reported optimal_io_size not divisible by 4096. Fix busy-loop in config reading when read returned 0. Fix DM cache preserving logic (2.03.28). Improve use of lvmlockd for usecases involving thin volumes and pools. Version 2.03.30 - 14th January 2025 =================================== Lvresize reports origin vdo volume cannot be resized. Support setting reserved_memory|stack of --config cmdline. Fix support for disabling memory locking (2.03.27). Do not extend an LV if FS resize unsupported and '--fs resize' used. Prevent leftover temporary device when converting in use volume to a pool. lvconvert detects early volume in use when converting it to a pool. Handle NVMe with quirk changed WWID not matching WWID in devices file. Version 2.03.29 - 09th December 2024 ==================================== Configure --enable/disable-sd-notify to control lvmlockd build with sd-notify. Allow test mode when lvmlockd is built without dlm support. Add a note about RAID + integrity synchronization to lvmraid(7) man page. Add a function for running lvconvert --repair on RAID LVs to lvmdbusd. Improve option section of man pages for listing commands ({pv,lv,vg}{s,display}). Fix renaming of raid sub LVs when converting a volume to raid (2.03.28). Fix segfault/VG write error for raid LV lvextend -i|--stripes -I|--stripesize. Revert ignore -i|--stripes, -I|--stripesize for lvextend on raid0 LV (2.03.27). Version 2.03.28 - 04th November 2024 ==================================== Use radix_tree to lookup for UUID within committed metadata. Use radix_tree to lookup LV list entry within VG struct. Introduce setting config/validate_metadata = full | none. Restore fs resize call for lvresize -r on the same size LV (2.03.17). Correct off-by-one devicesfile backup counting. Replace use of dm_hash with radix_tree for lv names and uuids. Refactor vg_validate with uniq_insert and better use of CPU caches. Add radix_tree_uniq_insert. Update DM cache when taking next VG lock instead of dropping it. Generate json string id only for json reporting. For vgsummary use new API call dm_config_parse_only_section(). Use radix_tree for PV names mapping. Split check_lv_segment into separate _in/complete_vg variant. Use find_lv instead of find_lv_in_vg when possible. Do a mirror fixup only when mirrors with logs are imported. Add faster crc32 calculation from zlib code for x86_64. Fall back to direct zeroing if BLKZEROOUT fails during new LV initialization. Version 2.03.27 - 02nd October 2024 =================================== Fix swap device size detection using blkid for lvresize/lvreduce/lvextend. Detect GPT partition table and pass partition filter if no partitions defined. Add global/sanlock_align_size option to configure sanlock lease size. Disable mem locking when activation/reserved_stack or reserved_memory is 0. Fix locking issues in lvmlockd leaving thin pool locked. Deprecate vdo settings vdo_write_policy and vdo_write_policy. Lots of typo fixes across lvm2 code base (codespell). Corrected integrity parameter interleave_sectors for DM table line. Ignore -i|--stripes, -I|--stripesize for lvextend on raid0 LV, like raid10. Do not accept duplicate device names for pvcreate. Version 2.03.26 - 23rd August 2024 ================================== Fix internal error reported by pvmove on a VG with single PV. Also accept --mknodes --refresh for vgscan. Fix vgmknodes --refresh to wait for udev before checking /dev content. Use log/report_command_log=1 config setting by default for JSON output format. Fix unreleased memory pools on RAID lvextend. Add --integritysettings option to manipulate dm-integrity settings. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-04-26 11:39:56 +08:00
@@ -214,9 +217,12 @@ static void _allocate_memory(void)
free(areas[area]);
_size_malloc_tmp /= 2;
} else {
+#endif
++ area;
missing -= _size_malloc_tmp;
+#ifdef __GLIBC__
}
+#endif
if (area == max_areas && missing > 0) {
/* Too bad. Warn the user and proceed, as things are
lvm2: update to version 2.03.31 and libdm version 1.02.205 Version 2.03.31 - 27th February 2025 ==================================== Reduce 'mandoc -T lint' reported issues for man pages. Restore support for LVM_SUPPRESS_FD_WARNINGS (2.03.24). Fix uncache and split cache restoring original state of volume. Extend use of lockopt skip to more scenarios. Enhance error path resolving in polling code. Disallow shared activation of LV with CoW snapshot. Fix lvmlockd use in lvremove of CoW snapshot, VDO pool, and uncache. Improve mirror split with opened temporary volumes. Improve pvmove finish with opened temporary volumes. Fix backup limit for devices file, handle over 10,000 files. Ignore reported optimal_io_size not divisible by 4096. Fix busy-loop in config reading when read returned 0. Fix DM cache preserving logic (2.03.28). Improve use of lvmlockd for usecases involving thin volumes and pools. Version 2.03.30 - 14th January 2025 =================================== Lvresize reports origin vdo volume cannot be resized. Support setting reserved_memory|stack of --config cmdline. Fix support for disabling memory locking (2.03.27). Do not extend an LV if FS resize unsupported and '--fs resize' used. Prevent leftover temporary device when converting in use volume to a pool. lvconvert detects early volume in use when converting it to a pool. Handle NVMe with quirk changed WWID not matching WWID in devices file. Version 2.03.29 - 09th December 2024 ==================================== Configure --enable/disable-sd-notify to control lvmlockd build with sd-notify. Allow test mode when lvmlockd is built without dlm support. Add a note about RAID + integrity synchronization to lvmraid(7) man page. Add a function for running lvconvert --repair on RAID LVs to lvmdbusd. Improve option section of man pages for listing commands ({pv,lv,vg}{s,display}). Fix renaming of raid sub LVs when converting a volume to raid (2.03.28). Fix segfault/VG write error for raid LV lvextend -i|--stripes -I|--stripesize. Revert ignore -i|--stripes, -I|--stripesize for lvextend on raid0 LV (2.03.27). Version 2.03.28 - 04th November 2024 ==================================== Use radix_tree to lookup for UUID within committed metadata. Use radix_tree to lookup LV list entry within VG struct. Introduce setting config/validate_metadata = full | none. Restore fs resize call for lvresize -r on the same size LV (2.03.17). Correct off-by-one devicesfile backup counting. Replace use of dm_hash with radix_tree for lv names and uuids. Refactor vg_validate with uniq_insert and better use of CPU caches. Add radix_tree_uniq_insert. Update DM cache when taking next VG lock instead of dropping it. Generate json string id only for json reporting. For vgsummary use new API call dm_config_parse_only_section(). Use radix_tree for PV names mapping. Split check_lv_segment into separate _in/complete_vg variant. Use find_lv instead of find_lv_in_vg when possible. Do a mirror fixup only when mirrors with logs are imported. Add faster crc32 calculation from zlib code for x86_64. Fall back to direct zeroing if BLKZEROOUT fails during new LV initialization. Version 2.03.27 - 02nd October 2024 =================================== Fix swap device size detection using blkid for lvresize/lvreduce/lvextend. Detect GPT partition table and pass partition filter if no partitions defined. Add global/sanlock_align_size option to configure sanlock lease size. Disable mem locking when activation/reserved_stack or reserved_memory is 0. Fix locking issues in lvmlockd leaving thin pool locked. Deprecate vdo settings vdo_write_policy and vdo_write_policy. Lots of typo fixes across lvm2 code base (codespell). Corrected integrity parameter interleave_sectors for DM table line. Ignore -i|--stripes, -I|--stripesize for lvextend on raid0 LV, like raid10. Do not accept duplicate device names for pvcreate. Version 2.03.26 - 23rd August 2024 ================================== Fix internal error reported by pvmove on a VG with single PV. Also accept --mknodes --refresh for vgscan. Fix vgmknodes --refresh to wait for udev before checking /dev content. Use log/report_command_log=1 config setting by default for JSON output format. Fix unreleased memory pools on RAID lvextend. Add --integritysettings option to manipulate dm-integrity settings. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-04-26 11:39:56 +08:00
@@ -540,8 +546,13 @@ static void _lock_mem(struct cmd_context
* will not block memory locked thread
* Note: assuming _memlock_count_daemon is updated before _memlock_count
*/
+#ifdef __GLIBC__
_use_mlockall = _memlock_count_daemon ? 1 :
find_config_tree_bool(cmd, activation_use_mlockall_CFG, NULL);
+#else
+ /* always use mlockall on musl */
+ _use_mlockall = 1;
+#endif
if (!_use_mlockall) {
if (!*_procselfmaps &&