mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] module: pr_debug when there is no version info
@ 2025-07-21  4:52 Wang Jinchao
  2025-07-21 14:40 ` Petr Pavlu
  0 siblings, 1 reply; 7+ messages in thread
From: Wang Jinchao @ 2025-07-21  4:52 UTC (permalink / raw)
  To: Luis Chamberlain, Petr Pavlu, Daniel Gomez, Sami Tolvanen
  Cc: linux-kernel, Wang Jinchao, linux-modules

When there is no version information, modprobe and insmod only
report "invalid format".
Print the actual cause to make it easier to diagnose the issue.
This helps developers quickly identify version-related module
loading failures.
Signed-off-by: Wang Jinchao <wangjinchao600@gmail.com>
---
 kernel/module/version.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/module/version.c b/kernel/module/version.c
index 2beefeba82d9..bc28c697ff3a 100644
--- a/kernel/module/version.c
+++ b/kernel/module/version.c
@@ -42,8 +42,10 @@ int check_version(const struct load_info *info,
 	}
 
 	/* No versions at all?  modprobe --force does this. */
-	if (versindex == 0)
+	if (versindex == 0) {
+		pr_debug("No version info for module %s\n", info->name);
 		return try_to_force_load(mod, symname) == 0;
+	}
 
 	versions = (void *)sechdrs[versindex].sh_addr;
 	num_versions = sechdrs[versindex].sh_size
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-08-26  9:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-21  4:52 [PATCH] module: pr_debug when there is no version info Wang Jinchao
2025-07-21 14:40 ` Petr Pavlu
2025-07-22  3:08   ` Wang Jinchao
2025-07-22  8:25     ` Petr Pavlu
2025-07-23  4:39       ` Wang Jinchao
2025-08-26  7:20       ` Petr Pavlu
2025-08-26  9:45         ` Jinchao Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®