Keith Owens wrote: >On Mon, 26 May 2003 23:45:39 -0500, >Corey Minyard wrote: > > >>Keith Owens wrote: >> >> >>>>Why can't you have a module id in the notifier chain, and use a boolean >>>>to tell if it is set, or something similar to that? That way you could >>>>mix them, if the bool is set then do the try_in_module_count thing, if >>>>not then just call the function. It does add some components to the >>>>register structure, but that shouldn't hurt anything besides taking a >>>>little more memory. >>>> >>>> >>>It is a change of API in a 2.4 kernel. Not a good idea. >>> >>> >>> >>Does adding a field to a structure (where the user does not have to do >>anything with the >>field) change the API? That would be the only API change here. >> >> > >The user does have to do something. Every piece of code that calls >notify_register has to set the new field to __THIS_MODULE. WIthout >that field being set, you are no better off, the race still exists. > Why? The user doesn't have to set the field, you can let the registration code do that. I have attached a patch as an example. (It also seems safer to get the next field from the notifier before calling it, in case the called code removes itself and puts itself on another list, or something like that, so I made that change). -Corey