Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45745
b: refs/heads/master
c: 1b5180b
h: refs/heads/master
i:
  45743: 072457a
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jan 23, 2007
1 parent 84eb6fc commit 038bd5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b53d0b919ebe227e2b8e49b6e0ddee506be83aa8
refs/heads/master: 1b5180b65122666a36a1a232b7b9b38b21a9dcdd
15 changes: 11 additions & 4 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,18 @@ EXPORT_SYMBOL_GPL(blocking_notifier_chain_unregister);
int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
unsigned long val, void *v)
{
int ret;
int ret = NOTIFY_DONE;

down_read(&nh->rwsem);
ret = notifier_call_chain(&nh->head, val, v);
up_read(&nh->rwsem);
/*
* We check the head outside the lock, but if this access is
* racy then it does not matter what the result of the test
* is, we re-check the list after having taken the lock anyway:
*/
if (rcu_dereference(nh->head)) {
down_read(&nh->rwsem);
ret = notifier_call_chain(&nh->head, val, v);
up_read(&nh->rwsem);
}
return ret;
}

Expand Down

0 comments on commit 038bd5c

Please sign in to comment.