1. I have a kernel moduleA that is dependent on other kernel moduleB and if I try to unload moduleA, it returns no error
2. And if I repeat step 1 it returns device busy error message.
3. Now unload moduleB and it removed successfully
4. Now by default module A is unloaded without giving user any clue.
This is how module refcounts work. kldunload just decrements the administrative refcount. But a module isn't unloaded until all refs drop to zero.
What would you prefer happen? EBUSY and do not drop the administrative ref if a module has dependencies?
Thanks for the comment.
Yes, I expect EBUSY and do not drop the administrative ref if a module has dependencies.
Also the error message EBUSY doe snot coem for teh first time and reruuning the same will return EBUSY with dependencies.
Could you please give an example using real modules, commands and output?