Also the close routine, otherwise there is a window where the use count
is 0 but code is still executing in the module.
Network operations such as SIOCGIFHWADDR take an interface name and do
not call any 'open' routine. The only lock I can see around dev_ifsioc
is dev_base_lock, AFAICT that will not protect against a module being
unloaded while SIOCGIFHWADDR is running. If dev_base_lock does protect
against module unload, it is not clear that it does so.
For netfilter, the use count reflects the number of packets being
processed. Complex and potentially high overhead.
All of this requires that the module information be passed in multiple
structures and assumes that all code is careful about reference
counting the code it is about to execute. There has to be a better
way!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/