Re: [PATCH] LOCKDEP: minor fix for debug_show_all_locks()

From: Ingo Molnar
Date: Tue Oct 28 2008 - 05:32:05 EST



* qinghuang feng <qhfeng.kernel@xxxxxxxxx> wrote:

> When we failed to get tasklist_lock eventually (count equals 0),
> we should only print " ignoring it.\n", and not print
> " locked it.\n" needlessly.
>
> Signed-off-by: Qinghuang Feng <qhfeng.kernel@xxxxxxxxx>
> ---

> diff --git a/kernel/lockdep.c b/kernel/lockdep.c
> index dbda475..6533fd9 100644
> --- a/kernel/lockdep.c
> +++ b/kernel/lockdep.c
> @@ -3417,8 +3417,7 @@ retry:
> }
> printk(" ignoring it.\n");
> unlock = 0;
> - }
> - if (count != 10)
> + } else if (count != 10)
> printk(" locked it.\n");
>

applied to tip/core/urgent, thanks!

note that i've done two small tweaks to the patch:

- added curly braces to the else branch as well - the convention is
to mirror the curly braces of the main branch in such cases.

- added KERN_CONT for the printk

Ingo

-------------->