diff mbox series

[13/27] lnet: libcfs: cleanup console messages

Message ID 1681739243-29375-14-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to OpenSFS branch April 17, 2023 | expand

Commit Message

James Simmons April 17, 2023, 1:47 p.m. UTC
From: Andreas Dilger <adilger@whamcloud.com>

Change early libcfs cfs_cpu_init() messages from CERROR() to
pr_err() to avoid circular dependencies on libcfs setup before
printing an error message to the console during module init.

WC-bug-id: https://jira.whamcloud.com/browse/LU-16639
Lustre-commit: 8f40a3d7110da1af8e ("LU-16639 misc: cleanup concole messages")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50283
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Feng Lei <flei@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/libcfs/libcfs_cpu.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/libcfs/libcfs_cpu.c b/net/lnet/libcfs/libcfs_cpu.c
index dca92cd..a5bf4f6 100644
--- a/net/lnet/libcfs/libcfs_cpu.c
+++ b/net/lnet/libcfs/libcfs_cpu.c
@@ -1177,27 +1177,27 @@  int cfs_cpu_init(void)
 	if (*cpu_pattern) {
 		cfs_cpt_tab = cfs_cpt_table_create_pattern(cpu_pattern);
 		if (IS_ERR(cfs_cpt_tab)) {
-			CERROR("Failed to create cptab from pattern '%s'\n",
-			       cpu_pattern);
 			ret = PTR_ERR(cfs_cpt_tab);
+			pr_err("libcfs: failed to create cptab from pattern '%s': rc = %d\n",
+			       cpu_pattern, ret);
 			goto failed_alloc_table;
 		}
 
 	} else {
 		cfs_cpt_tab = cfs_cpt_table_create(cpu_npartitions);
 		if (IS_ERR(cfs_cpt_tab)) {
-			CERROR("Failed to create cptab with npartitions %d\n",
-			       cpu_npartitions);
 			ret = PTR_ERR(cfs_cpt_tab);
+			pr_err("libcfs: failed to create cptab with npartitions=%d: rc = %d\n",
+			       cpu_npartitions, ret);
 			goto failed_alloc_table;
 		}
 	}
 
 	put_online_cpus();
 
-	LCONSOLE(0, "HW NUMA nodes: %d, HW CPU cores: %d, npartitions: %d\n",
-		 num_online_nodes(), num_online_cpus(),
-		 cfs_cpt_number(cfs_cpt_tab));
+	pr_notice("libcfs: HW NUMA nodes: %d, HW CPU cores: %d, npartitions: %d\n",
+		  num_online_nodes(), num_online_cpus(),
+		  cfs_cpt_number(cfs_cpt_tab));
 	return 0;
 
 failed_alloc_table: