]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
mdadm: Fix testcase 06wrmostly
authorMingli Yu <mingli.yu@windriver.com>
Thu, 16 Mar 2023 08:49:57 +0000 (16:49 +0800)
committerSteve Sakoman <steve@sakoman.com>
Tue, 21 Mar 2023 16:47:08 +0000 (06:47 -1000)
Backport patch [1] to fix the failure of the 06wrmostly test.

[1] https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=41edf6f45895193f4a523cb0a08d639c9ff9ccc9

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit 9c73484cb12f39662a8f10027a55c63b95373066)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-extended/mdadm/files/0001-mdadm-Fix-optional-write-behind-parameter.patch [new file with mode: 0644]
meta/recipes-extended/mdadm/mdadm_4.2.bb

diff --git a/meta/recipes-extended/mdadm/files/0001-mdadm-Fix-optional-write-behind-parameter.patch b/meta/recipes-extended/mdadm/files/0001-mdadm-Fix-optional-write-behind-parameter.patch
new file mode 100644 (file)
index 0000000..186d1e7
--- /dev/null
@@ -0,0 +1,45 @@
+From 41edf6f45895193f4a523cb0a08d639c9ff9ccc9 Mon Sep 17 00:00:00 2001
+From: Logan Gunthorpe <logang@deltatee.com>
+Date: Wed, 22 Jun 2022 14:25:12 -0600
+Subject: [PATCH] mdadm: Fix optional --write-behind parameter
+
+The commit noted below changed the behaviour of --write-behind to
+require an argument. This broke the 06wrmostly test with the error:
+
+  mdadm: Invalid value for maximum outstanding write-behind writes: (null).
+         Must be between 0 and 16383.
+
+To fix this, check if optarg is NULL before parising it, as the origial
+code did.
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=41edf6f45895193f4a523cb0a08d639c9ff9ccc9]
+
+Fixes: 60815698c0ac ("Refactor parse_num and use it to parse optarg.")
+Cc: Mateusz Grzonka <mateusz.grzonka@intel.com>
+Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
+Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ mdadm.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/mdadm.c b/mdadm.c
+index d0c5e6de..56722ed9 100644
+--- a/mdadm.c
++++ b/mdadm.c
+@@ -1201,8 +1201,9 @@ int main(int argc, char *argv[])
+               case O(BUILD, WriteBehind):
+               case O(CREATE, WriteBehind):
+                       s.write_behind = DEFAULT_MAX_WRITE_BEHIND;
+-                      if (parse_num(&s.write_behind, optarg) != 0 ||
+-                      s.write_behind < 0 || s.write_behind > 16383) {
++                      if (optarg &&
++                          (parse_num(&s.write_behind, optarg) != 0 ||
++                           s.write_behind < 0 || s.write_behind > 16383)) {
+                               pr_err("Invalid value for maximum outstanding write-behind writes: %s.\n\tMust be between 0 and 16383.\n",
+                                               optarg);
+                               exit(2);
+-- 
+2.25.1
+
index 19035caaec9eee4b40f3a9ff2f1c8109836c4dc1..be08d512d729c76ce24bce32e9c6f74e44956742 100644 (file)
@@ -24,6 +24,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
            file://0001-mdadm-skip-test-11spare-migration.patch \
            file://0001-Fix-parsing-of-r-in-monitor-manager-mode.patch \
            file://0001-Makefile-install-mdcheck.patch \
+           file://0001-mdadm-Fix-optional-write-behind-parameter.patch \
            "
 
 SRC_URI[sha256sum] = "461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d"