Re: [Lse-tech] Re: [PATCH 0/7]: Fix for unsafe notifier chain

Greg KH
2005-11-27T22:03:56Z

On Sun, Nov 27, 2005 at 11:56:40AM -0800, Andrew Morton wrote:
> We're saying that kernel/sys.c:notifier_lock should be removed and that all
> callers of notifier_chain_register(), notifier_chain_unregister() and
> notifier_call_chain() should be changed to define and use their own lock.
>
> So the _callers_ get to decide whether they're going to use down(),
> spin_lock(), down_read(), read_lock(), preempt_disable(), local_irq_disable()
> or whatever.

I completely agree. I just watched in mute horror as Chandra and Alan
spun off into the rcu blackhole trying to create one-size-fits-all
notifiers.

Making the user do the locking it needs to do is simple and sane.

And the reason USB's notifiers are implemented correctly, is they don't
use the notifier core, but rather, reimplemented their own, due to the
locking mess.

thanks,

greg k-h