git: 3569e21f0714 - stable/14 - khelp: suppress useless warning message on shutdown

From: Mike Karels <karels_at_FreeBSD.org>
Date: Fri, 24 Nov 2023 18:11:48 UTC
The branch stable/14 has been updated by karels:

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

commit 3569e21f07147c8dd4bee82e5e7efe69c98edeb1
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-11-17 18:51:18 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-11-24 18:11:16 +0000

    khelp: suppress useless warning message on shutdown
    
    If a module (e.g. the ertt hhook for TCP) can't clean up at
    shutdown, there is nothing to be done about it.  In the ertt case,
    cleanup is just shutting down a UMA zone, which doesn't need to be
    done.  Suppress EBUSY warnings on shutdown.
    
    PR:             271677
    Reviewed by:    tuexen, imp
    Differential Revision:  https://reviews.freebsd.org/D42650
    
    (cherry picked from commit 415c1c748d5492e41328fedf96b6bf3c9be94595)
---
 sys/kern/kern_khelp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/kern_khelp.c b/sys/kern/kern_khelp.c
index 3d75da141b48..f8a6f3e749da 100644
--- a/sys/kern/kern_khelp.c
+++ b/sys/kern/kern_khelp.c
@@ -357,7 +357,7 @@ khelp_modevent(module_t mod, int event_type, void *data)
 		} else if (error == ENOENT)
 			/* Do nothing and allow unload if helper not in list. */
 			error = 0;
-		else if (error == EBUSY)
+		else if (error == EBUSY && event_type != MOD_SHUTDOWN)
 			printf("Khelp module \"%s\" can't unload until its "
 			    "refcount drops from %d to 0.\n", kmd->name,
 			    kmd->helper->h_refcount);