Page MenuHomeFreeBSD

kern linker: Do not try to unload module if it has dependants
ClosedPublic

Authored by zlei on Nov 9 2023, 10:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 28, 12:55 AM
Unknown Object (File)
Thu, Nov 27, 3:52 PM
Unknown Object (File)
Tue, Nov 25, 8:16 PM
Unknown Object (File)
Tue, Nov 18, 11:01 PM
Unknown Object (File)
Thu, Nov 6, 12:51 PM
Unknown Object (File)
Nov 1 2025, 11:51 AM
Unknown Object (File)
Oct 29 2025, 4:05 PM
Unknown Object (File)
Oct 29 2025, 12:28 PM

Details

Summary

linker_file_unload() will just drop a reference in case the module have more than one
references. For user requested unload, we are going to unload but not just to drop a
reference.

PR: 274986
MFC after: 2 weeks

Test Plan
# kldload bridgestp
# kldload if_bridge
# kldunload bridgestp
kldunload: can't unload file: Device busy

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

zlei requested review of this revision.Nov 9 2023, 10:06 AM
This revision is now accepted and ready to land.Nov 9 2023, 3:46 PM
jhb added a subscriber: jhb.
jhb added inline comments.
sys/kern/kern_linker.c
1285–1286

I think this is more readable.