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.
--
| Lee Revell | Re: [RFC][PATCH] cpuidle: avoid singing capacitors |
| Ingo Molnar | [bug] latest -git boot hang |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Christoph Hellwig | Re: 2.6.24-rc6-mm1 |
git: | |
| Imran M Yousuf | Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins |
| Dan Zwell | [PATCH] Color support added to git-add--interactive. |
| Kyle Moffett | Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Petr Vandrovec | Re: Fwd: [OT] Re: Git via a proxy server? |
| Lars Hansson | Re: Code signing in OpenBSD |
| Richard Stallman | Real men don't attack straw men |
| Pau | acer aspire one dmesg? |
| Henning Brauer | Re: About Xen: maybe a reiterative question but .. |
| Jarek Poplawski | Re: loaded router, excessive getnstimeofday in oprofile |
| Julius Volz | [PATCH RFC 20/24] IPVS: Add validity checks when adding/editing v6 services |
| Bruno | [PATCH 1/2] r8169: WoL fixes |
| Corey Hickey | [PATCH 01/10] Preparatory refactoring part 1. |
