From: Nick Hainke Date: Sun, 10 Apr 2022 07:00:59 +0000 (+0200) Subject: mdadm: update to 4.2 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ab4eafbed974c6ead13b11a50b3032670c26540a;p=openwrt%2Fstaging%2Fnbd.git mdadm: update to 4.2 Refreshed patches: - 100-cross_compile.patch Manually refreshed patches: - 200-reduce_size.patch Removed patches: - 101-mdadm.h-Undefine-dprintf-before-redefining.patch - 102-Add-missing-include-file-sys-sysmacros.h.patch Changes: e30ca260 Release mdadm-4.2 8c80d305 Monitor: print message before quit for no array to monitor ced5fa8b mdadm: block creation with long names b71de056 Correct checking if file descriptors are valid b2e4f084 Incremental: Close unclosed mdfd in IncrementalScan() 195d1d76 imsm: assert if there is migration but prev_map doesn't exist 75f3ba25 imsm: free allocated memory in imsm_fix_size_mismatch bce0eab3 Release mdadm-4.2-rc3 4389ce73 imsm: introduce helpers to manage file descriptors 8e1a258e mdadm/Detail: Can't show container name correctly when unpluging disks a35aa68f mdadm/lib: Define a new helper function is_dev_alived 1c66260d Fix 2 dc stream buffer d64a37b9 Assemble: apply sysfs rules 5f6dedfb Fix potential overlap dest buffer a0422106 disallow create or grow clustered bitmap with writemostly set cf16a350 Fix buffer size warning for strcpy 60815698 Refactor parse_num and use it to parse optarg. f7889e51 Fix error message when creating raid 4, 5 and 10 54604768 mdadm: fix coredump of mdadm --monitor -r feeb2785 Utils: Change sprintf to snprintf b8bbf264 Release mdadm-4.2-rc2 e6878148 Assemble: skip devices that don't match uuid instead of aborting the assembly. 0663137c Add monitor delay parameter to mdadm.conf 2b2c5668 tests: Avoid passing chunk size when creating RAID 1 7d374a18 Fix memory leak after "mdadm --detail" 92a647c8 Assemble: start dirty and degraded array. 1c275381 imsm: fix num_data_stripes after raid0 takeover 5b30a34a Add error handling for chunk size in RAID1 3a85bf0e imsm: Fix possible memory leaks and refactor freeing struct dl ccd61ebf mdadm: Fix building errors 601ffa78 Don't associate spares with other arrays during RAID Examine 8d69bf14 Remove Spare drives line from details for external metadata 7d8935cb imsm: correct offset for 4k disks in --examine output dca80fcd Use dev_open in validate geometry container f421731c mdadm/super1: It needs to specify int32 for bitmap_offset 1f5d54a0 Manage: Call validate_geometry when adding drive to external container 8662f92d imsm: Limit support to the lowest namespace fcebeb77 imsm: add devpath_to_char method 7c798f87 imsm: add generic method to resolve "device" links 0530e2e0 Prevent user from using --stop with ambiguous args 83b3de77 Fix some building errors ff904202 imsm: change wrong size verification c11b1c3c Release mdadm-4.2-rc1 aec01630 super-intel.c: Handle errors from calls to get_dev_sector_size() 78c93b00 mdadm: fix growing containers af3396da Monitor: make libudev dependency optional f94df5cf imsm: support for third Sata controller d835518b imsm: nvme multipath support 4036e7ee imsm: extend curr_migr_unit to u64 bdbe7f81 Grow: Block reshape when external metadata and write-intent bitmap 848d71c9 Create: Block automatic enabling bitmap for external metadata 19ad203e imsm: Update-subarray for write-intent bitmap dc95f821 Add "bitmap" to allowed command-line values 69d40de4 imsm: Adding a spare to an existing array with bitmap fbc42556 imsm: Write-intent bitmap support b554ab5c Enable bitmap support for external metadata b090e910 Modify mdstat parsing for volumes with the bitmap db537788 It should be FAILED when raid has not enough active disks c7b8547c imsm: add verbose flag to compare_super 49b69533 mdmonitor: check if udev has finished events processing 0d583954 Document PPL in man md 2f86fda3 imsm: use saved fds during migration f7a6246b super1.c: avoid useless sync when bitmap switches from clustered to none e6561c4d super1: fix Floating point exception 8818d4e7 Grow: be careful of corrupt dev_roles list 4ae96c80 mdadm: fix reshape from RAID5 to RAID6 with backup file 1fe2e100 mdadm/bitmap: locate bitmap calcuate bitmap position wrongly 75562b57 Dump: get stat from a wrong metadata file when restoring metadata 69068584 Incremental: Remove redundant spare movement logic a64f1263 udev: start grow service automatically b4a5ad49 Make target to install binaries only 9c030dad mdadm/Detail: show correct state for clustered array ff6bb131 mdadm: Unify forks behaviour a8f3cfd5 imsm: limit support to first NVMe namespace ca4b156b Monitor: don't use default modes when creating a file b65c1f4a imsm: remove redundant calls to imsm_get_map 895ffd99 imsm: update num_data_stripes according to dev_size ce559078 Create.c: close mdfd and generate uevent c3129b39 Detail: fix segfault during IMSM raid creation 97b51a2c Super1: allow RAID0 layout setting to be removed. 7f3b2d1d Check if other Monitor instance running before fork. cab9c67d mdmonitor: set small delay once 007087d0 Monitor: stop notifing about containers. e2308733 Monitor: refresh mdstat fd after select 2ce09172 Don't create bitmap for raid5 with journal disk 64bf4dff Detail: show correct raid level when the array is inactive 5f418455 manual: update --examine-badblocks 5e592e1e mdadm/md.4: update path to in-kernel-tree documentation 138a9e9b Specify nodes number when updating cluster nodes 77b72fa8 mdadm/Grow: prevent md's fd from being occupied during delayed time bcf40dbb Update link to Intel page for IMSM 8e41153c Use more secure HTTPS URLs 2cf04330 Detect too-small device: error rather than underflow/crash 7758ada9 Block overwriting existing links while manual assembly d92cee7b restripe: fix ignoring return value of ‘read’ and lseek 7d90f760 Include count for \0 character when using strncpy to implement strdup. f4c8a605 uuid.c: split uuid stuffs from util.c 03ab9763 Makefile: add EXTRAVERSION support 3b7aae92 mdcheck: Log when done 7b99edab Assemble.c: respect force flag. ec7d7cee clean up meaning of small typo 5cfb79de Assemble: print error message if mdadm fails assembling with --uuid option 12724c01 Manage, imsm: Write metadata before add 1c294b5d Detail: adding sync status for cluster device 185ec439 Monitor: improve check_one_sharer() for checking duplicated process e1b92ee0 udev: Ignore change event for imsm ba1b3bc8 imsm: show Subarray and Volume ID in --examine output e48aed3c imsm: support the Array Creation Time field in metadata 9e449405 Detail: show correct bitmap info for cluster raid device 06a6101c imsm: Correct minimal device size. 45c43276 imsm: Remove --dump/--restore implementation 3364781b imsm: pass subarray id to kill_subarray function fd38b8ea Remove the legacy whitespace 2551061c mdadm.8: add note information for raid0 growing operation 1e93d0d1 imsm: fill working_disks according to metadata. 42e641ab Add support for Tebibytes 4431efeb imsm: Update grow manual. e1512e7b mdcheck service can't start succesfully because of syntax error 1a874930 Change warning message aced6fc9 Respect $(CROSS_COMPILE) when $(CC) is the default 027c099f Assemble: add support for RAID0 layouts. 329dfc28 Create: add support for RAID0 layouts. 6da53c0e imsm: Change the way of printing nvme drives in detail-platform. b771faef imsm: return correct uuid for volume in detail 4b31846f Remove unused code 9cf361f8 Fix up a few formatting issues 02af3793 Remove last traces of HOT_ADD_DISK 1cc3965d Manage: Remove the legacy code for md driver prior to 0.90.03 761e3bd9 super-intel: don't mark structs 'packed' unnecessarily 85b83a79 SUSE-mdadm_env.sh: handle MDADM_CHECK_DURATION 4ca799c5 mdcheck: use ${} to pass variable to mdcheck 6636788a mdcheck: when mdcheck_start is enabled, enable mdcheck_continue too. 1a1ced1e imsm: allow to specify second volume size b6180160 imsm: save current_vol number 7bd59e79 udev: allow for udev attribute reading bug. 61109314 Don't need to check recovery after re-add when no I/O writes to raid 8063fd0f Init devlist as an array e53cb968 mdadm/md.4: add the descriptions for bitmap sysfs nodes 2c2d9c48 mdadm: force a uuid swap on big endian 43ebc910 mdadm: Introduce new array state 'broken' for raid0/linear fd5b09c9 mdadm: check value returned by snprintf against errors 91c97c54 imsm: close removed drive fd. 1a52f1fc udev: add --no-devices option for calling 'mdadm --detail' d11abe4b mdadm: add --no-devices to avoid component devices detail information 452dc4d1 mdadm.h: include sysmacros.h unconditionally b0681598 mdadm: load default sysfs attributes after assemblation 486720e0 super-intel: Use put_unaligned in split_ull 7039d1f8 mdadm.h: Introduced unaligned {get,put}_unaligned{16,32}() a4f7290c super-intel: Fix issue with abs() being irrelevant 4ec389e3 Enable probe_roms to scan more than 6 roms. ae7d61e3 mdmon: fix wrong array state when disk fails during mdmon startup 3c9b46cf udev: Add udev rules to create by-partuuid for md device 22dc741f Create: Block rounding size to max 05501181 imsm: fix spare activation for old matrix arrays 227aeaa8 add missing units to --examine 2b57e4fe Assemble: Fix starting array with initial reshape checkpoint d2e11da4 mdmon: wait for previous mdmon to exit during takeover 69d08478 mdmon: don't attempt to manage new arrays when terminating 76b906d2 mdadm/tests: add one test case for failfast of raid1 cab114c5 Fix reshape for decreasing data offset e3615ecb Detail.c: do not skip first character when calling xstrdup in Detail() ebf3be99 Fix spelling typos. 9f421827 imsm: fix reshape for >2TB drives a4e96fd8 imsm: finish recovery when drive with rebuild fails 757e5543 policy.c: Fix for compiler error 467e6a1b policy.c: prevent NULL pointer referencing 76d505de Grow: report correct new chunk size. 085df422 Grow: avoid overflow in compute_backup_blocks() 563ac108 Assemble: mask FAILFAST and WRITEMOSTLY flags when finding the most recent device d7a1fda2 imsm: update metadata correctly while raid10 double degradation 7cd7e91a Monitor: add system timer to run --oneshot periodically 4199d3c6 mdcheck: add systemd unit files to run mdcheck. cd72f9d1 policy: support devices with multiple paths. 6b611284 Document PART-POLICY lines 0833f9c3 Assemble: keep MD_DISK_FAILFAST and MD_DISK_WRITEMOSTLY flag Signed-off-by: Nick Hainke --- diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile index f6696bf21c..553728194e 100644 --- a/package/utils/mdadm/Makefile +++ b/package/utils/mdadm/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mdadm -PKG_VERSION:=4.1 -PKG_RELEASE:=2 +PKG_VERSION:=4.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm -PKG_HASH:=ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a +PKG_HASH:=461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d PKG_MAINTAINER:=Felix Fietkau PKG_CPE_ID:=cpe:/a:mdadm_project:mdadm @@ -48,11 +48,16 @@ TARGET_CFLAGS += \ -DCONFFILE='\"/var/etc/mdadm.conf\"' \ -DMAP_DIR='\"/var/run/mdadm\"' \ -DMDMON_DIR='\"/var/run/mdadm\"' \ - -DFAILED_SLOTS_DIR='\"/var/run/mdadm/failed-slots\"' + -DFAILED_SLOTS_DIR='\"/var/run/mdadm/failed-slots\"' \ + -DNO_LIBUDEV + +TARGET_CXFLAGS = -DNO_LIBUDEV TARGET_LDFLAGS += -Wl,--gc-sections -MAKE_FLAGS += CHECK_RUN_DIR=0 +MAKE_FLAGS += \ + CHECK_RUN_DIR=0 \ + CXFLAGS="$(TARGET_CXFLAGS)" define Build/Compile $(call Build/Compile/Default,mdadm) diff --git a/package/utils/mdadm/patches/100-cross_compile.patch b/package/utils/mdadm/patches/100-cross_compile.patch index 0a5fa017c6..790d7755b0 100644 --- a/package/utils/mdadm/patches/100-cross_compile.patch +++ b/package/utils/mdadm/patches/100-cross_compile.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -97,7 +97,7 @@ DLM:=$(shell [ -f /usr/include/libdlm.h +@@ -99,7 +99,7 @@ DLM:=$(shell [ -f /usr/include/libdlm.h DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\" diff --git a/package/utils/mdadm/patches/101-mdadm.h-Undefine-dprintf-before-redefining.patch b/package/utils/mdadm/patches/101-mdadm.h-Undefine-dprintf-before-redefining.patch deleted file mode 100644 index 356d0deec8..0000000000 --- a/package/utils/mdadm/patches/101-mdadm.h-Undefine-dprintf-before-redefining.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6d369e8f226594632ce4260129509daf7030de0a Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 9 May 2016 22:03:57 +0000 -Subject: [PATCH] mdadm.h: Undefine dprintf before redefining - -dprintf is also defined in libc see -usr/include/bits/stdio2.h, this comes into -play especially when fortify sources is enabled -and compilers like clang reports the override - -In file included from policy.c:25: -./mdadm.h:1562:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined] - ^ -/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here - -Signed-off-by: Khem Raj ---- -Upstream-Status: Pending - - mdadm.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/mdadm.h -+++ b/mdadm.h -@@ -1649,11 +1649,13 @@ static inline char *to_subarray(struct m - } - - #ifdef DEBUG -+#undef dprintf - #define dprintf(fmt, arg...) \ - fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg) - #define dprintf_cont(fmt, arg...) \ - fprintf(stderr, fmt, ##arg) - #else -+#undef dprintf - #define dprintf(fmt, arg...) \ - ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; }) - #define dprintf_cont(fmt, arg...) \ diff --git a/package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch b/package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch deleted file mode 100644 index 891b5c62f0..0000000000 --- a/package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 452dc4d13a012cdcb05088c0dbc699959c4d6c73 Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Tue, 6 Aug 2019 16:05:23 +0300 -Subject: mdadm.h: include sysmacros.h unconditionally - -musl libc now also requires sys/sysmacros.h for the major/minor macros. -All supported libc implementations carry sys/sysmacros.h, including -diet-libc, klibc, and uclibc-ng. - -Cc: Hauke Mehrtens -Signed-off-by: Baruch Siach -Signed-off-by: Jes Sorensen ---- - mdadm.h | 2 -- - 1 file changed, 2 deletions(-) - ---- a/mdadm.h -+++ b/mdadm.h -@@ -45,10 +45,8 @@ extern __off64_t lseek64 __P ((int __fd, - #include - #include - #include --#ifdef __GLIBC__ - /* Newer glibc requires sys/sysmacros.h directly for makedev() */ - #include --#endif - #ifdef __dietlibc__ - #include - /* dietlibc has deprecated random and srandom!! */ diff --git a/package/utils/mdadm/patches/200-reduce_size.patch b/package/utils/mdadm/patches/200-reduce_size.patch index 6905c2ccfe..163e125c22 100644 --- a/package/utils/mdadm/patches/200-reduce_size.patch +++ b/package/utils/mdadm/patches/200-reduce_size.patch @@ -1,19 +1,19 @@ --- a/Incremental.c +++ b/Incremental.c -@@ -1619,6 +1619,10 @@ static int Incremental_container(struct - if (ra_all == ra_blocked) - return 0; +@@ -983,6 +983,10 @@ static int array_try_spare(char *devname + goto next; + } -+#ifndef MDADM_FULL -+ return 0; -+#endif ++ #ifndef MDADM_FULL ++ return 0; ++ #endif + - /* Now move all suitable spares from spare container */ - domains = domain_from_array(list, st->ss->name); - memcpy(suuid, uuid_zero, sizeof(int[4])); + dl = domain_from_array(sra, st2->ss->name); + if (domain_test(dl, pol, st2->ss->name) != 1) { + /* domain test fails */ --- a/util.c +++ b/util.c -@@ -1220,7 +1220,9 @@ void wait_for(char *dev, int fd) +@@ -1147,7 +1147,9 @@ void wait_for(char *dev, int fd) struct superswitch *superlist[] = { &super0, &super1,