diff options
| author | Oleg Nesterov <[email protected]> | 2014-01-23 15:55:39 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-01-23 16:37:01 -0800 |
| commit | d855a4b79f49ea07d1827fc0591490a6a324148b (patch) | |
| tree | f1169b0bc68f35548a3fd05c8b5da91814c38f8b /tools/perf/scripts/python/sched-migration.py | |
| parent | c986c14a6a88427946dc77d7018a81b95b3d41b6 (diff) | |
proc: don't (ab)use ->group_leader in proc_task_readdir() paths
proc_task_readdir() does not really need "leader", first_tid() has to
revalidate it anyway. Just pass proc_pid(inode) to first_tid() instead,
it can do pid_task(PIDTYPE_PID) itself and read ->group_leader only if
necessary.
The patch also extracts the "inode is dead" code from
pid_delete_dentry(dentry) into the new trivial helper,
proc_inode_is_dead(inode), proc_task_readdir() uses it to return -ENOENT
if this dir was removed.
This is a bit racy, but the race is very inlikely and the getdents() after
openndir() can see the empty "." + ".." dir only once.
Signed-off-by: Oleg Nesterov <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Sameer Nanda <[email protected]>
Cc: Sergey Dyasly <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions