Commit bbb1747d authored by Alan Stern's avatar Alan Stern Committed by Linus Torvalds
Browse files

[PATCH] Allow raw_notifier callouts to unregister themselves

Since raw_notifier chains don't benefit from any centralized locking
protections, they shouldn't suffer from the associated limitations.  Under
some circumstances it might make sense for a raw_notifier callout routine
to unregister itself from the notifier chain.  This patch (as678) changes
the notifier core to allow for such things.
Signed-off-by: default avatarAlan Stern <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent bfe5d834
...@@ -137,14 +137,15 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl, ...@@ -137,14 +137,15 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl,
unsigned long val, void *v) unsigned long val, void *v)
{ {
int ret = NOTIFY_DONE; int ret = NOTIFY_DONE;
struct notifier_block *nb; struct notifier_block *nb, *next_nb;
nb = rcu_dereference(*nl); nb = rcu_dereference(*nl);
while (nb) { while (nb) {
next_nb = rcu_dereference(nb->next);
ret = nb->notifier_call(nb, val, v); ret = nb->notifier_call(nb, val, v);
break; break;
nb = rcu_dereference(nb->next); nb = next_nb;
} }
return ret; return ret;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment