Re: [PATCH v2] ptrace: annotate siglock acquisition

From: Oleg Nesterov
Date: Sun Sep 26 2010 - 13:55:26 EST


On 09/25, Namhyung Kim wrote:
>
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -435,7 +435,8 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)
> unsigned long flags;
> int error = -ESRCH;
>
> - if (lock_task_sighand(child, &flags)) {
> + if (__cond_lock(&child->sighand->siglock,
> + lock_task_sighand(child, &flags))) {

Well, this looks fine, but if we are going to make sparse happy
then we have more callers to fix.

Perhaps we should just renam lock_task_sighand to __lock_task_sighand
and add

#define lock_task_sighand(tsk, flagsp) \
__cond_lock((tsk)->sighand->siglock, __lock_task_sighand((tsk), (flagsp)))

?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/