Blame SOURCES/0076-ndctl-test-Fix-support-for-missing-dax_pmem_compat-m.patch

2eb93d
From 9bfb567715d1b45e6598e6b38bef531312c72db3 Mon Sep 17 00:00:00 2001
2eb93d
From: Dan Williams <dan.j.williams@intel.com>
2eb93d
Date: Wed, 5 Jan 2022 13:32:21 -0800
2eb93d
Subject: [PATCH 076/217] ndctl/test: Fix support for missing dax_pmem_compat
2eb93d
 module
2eb93d
2eb93d
The kernel is moving to drop CONFIG_DEV_DAX_PMEM_COMPAT. Update
2eb93d
ndctl_test_init() to not error out if dax_pmem_compat is missing. It seems
2eb93d
that the original implementation of support for missing dax_pmem_compat was
2eb93d
broken, or since that time newer versions of kmod_module_new_from_name() no
2eb93d
longer fail when the module is missing.
2eb93d
2eb93d
Link: https://lore.kernel.org/r/164141834155.3990253.5388773351209410262.stgit@dwillia2-desk3.amr.corp.intel.com
2eb93d
Fixes: b7991dbc22f3 ("ndctl/test: Relax dax_pmem_compat requirement")
2eb93d
Tested-by: Alison Schofield <alison.schofield@intel.com>
2eb93d
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
2eb93d
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2eb93d
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
2eb93d
---
2eb93d
 test/core.c | 25 +++++++++++--------------
2eb93d
 1 file changed, 11 insertions(+), 14 deletions(-)
2eb93d
2eb93d
diff --git a/test/core.c b/test/core.c
2eb93d
index dc1405d..5d1aa23 100644
2eb93d
--- a/test/core.c
2eb93d
+++ b/test/core.c
2eb93d
@@ -120,7 +120,6 @@ int ndctl_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
2eb93d
 		"nfit",
2eb93d
 		"device_dax",
2eb93d
 		"dax_pmem",
2eb93d
-		"dax_pmem_core",
2eb93d
 		"dax_pmem_compat",
2eb93d
 		"libnvdimm",
2eb93d
 		"nd_btt",
2eb93d
@@ -180,29 +179,27 @@ int ndctl_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
2eb93d
 		/*
2eb93d
 		 * Skip device-dax bus-model modules on pre-v5.1
2eb93d
 		 */
2eb93d
-		if ((strcmp(name, "dax_pmem_core") == 0
2eb93d
-				|| strcmp(name, "dax_pmem_compat") == 0)
2eb93d
-				&& !ndctl_test_attempt(test,
2eb93d
-					KERNEL_VERSION(5, 1, 0)))
2eb93d
+		if ((strcmp(name, "dax_pmem_compat") == 0) &&
2eb93d
+		    !ndctl_test_attempt(test, KERNEL_VERSION(5, 1, 0)))
2eb93d
 			continue;
2eb93d
 
2eb93d
 retry:
2eb93d
 		rc = kmod_module_new_from_name(*ctx, name, mod);
2eb93d
-
2eb93d
-		/*
2eb93d
-		 * dax_pmem_compat is not required, missing is ok,
2eb93d
-		 * present-but-production is not ok.
2eb93d
-		 */
2eb93d
-		if (rc && strcmp(name, "dax_pmem_compat") == 0)
2eb93d
-			continue;
2eb93d
-
2eb93d
 		if (rc) {
2eb93d
-			log_err(&log_ctx, "%s.ko: missing\n", name);
2eb93d
+			log_err(&log_ctx, "failed to interrogate %s.ko\n",
2eb93d
+				name);
2eb93d
 			break;
2eb93d
 		}
2eb93d
 
2eb93d
 		path = kmod_module_get_path(*mod);
2eb93d
 		if (!path) {
2eb93d
+			/*
2eb93d
+			 * dax_pmem_compat is not required, missing is
2eb93d
+			 * ok, present-but-production is not ok.
2eb93d
+			 */
2eb93d
+			if (strcmp(name, "dax_pmem_compat") == 0)
2eb93d
+				continue;
2eb93d
+
2eb93d
 			if (family != NVDIMM_FAMILY_INTEL &&
2eb93d
 			    (strcmp(name, "nfit") == 0 ||
2eb93d
 			     strcmp(name, "nd_e820") == 0))
2eb93d
-- 
2eb93d
2.27.0
2eb93d