Skip to content
Commit a6fa941d authored by Al Viro's avatar Al Viro Committed by Ingo Molnar
Browse files

perf_event: Switch to internal refcount, fix race with close()



Don't mess with file refcounts (or keep a reference to file, for
that matter) in perf_event.  Use explicit refcount of its own
instead.  Deal with the race between the final reference to event
going away and new children getting created for it by use of
atomic_long_inc_not_zero() in inherit_event(); just have the
latter free what it had allocated and return NULL, that works
out just fine (children of siblings of something doomed are
created as singletons, same as if the child of leader had been
created and immediately killed).

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20120820135925.GG23464@ZenIV.linux.org.uk


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent e3e45c01
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