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
This commit is contained in:
Mike Karels 2023-11-17 12:51:18 -06:00
parent 115459be31
commit 415c1c748d

View file

@ -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);