From: Rusty Russell on
On Wed, 16 Jun 2010 09:56:37 am Yehuda Sadeh wrote:
> We should initialize the module dynamic debug datastructures
> only after determining that the module is not loaded yet. This
> fixes a bug that introduced in 2.6.35-rc2, where when a trying
> to load a module twice, we also load it's dynamic printing data
> twice which causes all sorts of nasty issues. Also handle
> the dynamic debug cleanup later on failure.
>
> Signed-off-by: Yehuda Sadeh <yehuda(a)hq.newdream.net>

Hi Yehuda,

Thanks for tracking this down. One minor comment:

> #if defined(CONFIG_DYNAMIC_DEBUG)
> -extern int ddebug_remove_module(char *mod_name);
> +extern int ddebug_remove_module(const char *mod_name);
>
> #define __dynamic_dbg_enabled(dd) ({ \
> int __ret = 0; \
> @@ -73,7 +73,7 @@ extern int ddebug_remove_module(char *mod_name);
>
> #else
>
> -static inline int ddebug_remove_module(char *mod)
> +static inline int ddebug_remove_module(const char *mod)
> {
> return 0;
> }

This implies we don't need the #ifdef here:

> +static void dynamic_debug_remove(struct _ddebug *debug)
> +{
> +#ifdef CONFIG_DYNAMIC_DEBUG
> + if (debug)
> + ddebug_remove_module(debug->modname);
> +#endif
> +}
> +

So I removed it. It'd be nice to have a similar wrapper in the header
for ddebug_add_module so we can avoid the #ifdef there too, but that's
a separate patch.

Applied!
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Rusty Russell on
On Sat, 3 Jul 2010 01:05:23 pm Linus Torvalds wrote:
> Is this missing a
>
> From: Yehuda Sadeh <yehuda(a)hq.newdream.net>
>
> author attribution by any chance? The sign-offs imply so.

Yep, thanks, re-sent.

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Linus Torvalds on
On Fri, Jul 2, 2010 at 7:35 PM, Rusty Russell <rusty(a)rustcorp.com.au> wrote:
> We should initialize the module dynamic debug datastructures
> only after determining that the module is not loaded yet. This
> fixes a bug that introduced in 2.6.35-rc2, where when a trying
> to load a module twice, we also load it's dynamic printing data
> twice which causes all sorts of nasty issues. Also handle
> the dynamic debug cleanup later on failure.
>
> Signed-off-by: Yehuda Sadeh <yehuda(a)hq.newdream.net>
> Signed-off-by: Rusty Russell <rusty(a)rustcorp.com.au> (removed a #ifdef)

Is this missing a

From: Yehuda Sadeh <yehuda(a)hq.newdream.net>

author attribution by any chance? The sign-offs imply so.

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