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

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