git: b36a4ee6687b - stable/12 - Annotate geom_md with MODULE_VERSION

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Sat, 12 Feb 2022 16:47:15 UTC
The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=b36a4ee6687b1407a6eeceda7d33e85d4b72a130

commit b36a4ee6687b1407a6eeceda7d33e85d4b72a130
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-02-10 06:15:29 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-02-12 16:46:41 +0000

    Annotate geom_md with MODULE_VERSION
    
    This was missed in 74d6c131cbe2 where other geom modules were annotated
    with MODULE_VERSION.  Again, the problem is the same: we can't detect
    that geom_md is loaded into the kernel without it.
    
    This was noticed in release builds on the cluster; mdconfig attempts to
    load geom_md because it can't detect it in the kernel, but the cluster
    config includes md(4) and does not build the kmod.  This problem would
    have been masked on hosts with the kmod built, as the kmod attempts to
    register the g_md module and fails.  With this commit, mdconfig would
    not even try to load it again.
    
    (cherry picked from commit b9c92d631cfb06c12b0d2d9ad29a9f3f0b856237)
---
 sys/dev/md/md.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 9e795a4a933b..641dff4f45d3 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -224,6 +224,7 @@ struct g_class g_md_class = {
 };
 
 DECLARE_GEOM_CLASS(g_md_class, g_md);
+MODULE_VERSION(geom_md, 0);
 
 
 static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(md_softc_list);