From: Wang Jinchao <wangjinchao600@gmail.com>
To: Luis Chamberlain <mcgrof@kernel.org>,
Petr Pavlu <petr.pavlu@suse.com>,
Daniel Gomez <da.gomez@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>
Cc: linux-kernel@vger.kernel.org,
Wang Jinchao <wangjinchao600@gmail.com>,
linux-modules@vger.kernel.org
Subject: [PATCH] module: pr_debug when there is no version info
Date: Mon, 21 Jul 2025 12:52:22 +0800 [thread overview]
Message-ID: <20250721045224.391745-1-wangjinchao600@gmail.com> (raw)
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
next reply other threads:[~2025-07-21 4:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 4:52 Wang Jinchao [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250721045224.391745-1-wangjinchao600@gmail.com \
--to=wangjinchao600@gmail.com \
--cc=da.gomez@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=samitolvanen@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®