Eric, Pavel.
Without tasklist lock held, task_tgid/task_pgrp/task_session can return the
bogus NULL. Note that the last 2 can return NULL even if task == current.
What do you think if we add yet another helper?
struct pid *leader_pid_type(struct task_struct *task, enum pid_type type)
{
struct pid *ret;
retry:
ret = task->group_leader->pids[type].pid;
if (likely(ret != NULL) || !pid_alive(task))
return ret;
/*
* We hit the old leader in the middle of de_thread(),
* or setsid/setpgrp is in progress.
*/
cpu_relax();
goto retry;
}
Yes, we already have a lot helpers... The one potential user is
check_kill_permission(), but it can live without it.
What do you think, do you see other possible users? Say, do_task_stat() may
report sid = 0, but this is minor of course...
Oleg.
--
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Matt Mackall | Re: [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c compiling |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
git: | |
