Re: [BLOCK2MTD] WARNING: at kernel/lockdep.c:2331 lockdep_init_map()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Zijlstra <a.p.zijlstra@...>
Cc: Erez Zadok <ezk@...>, <linux-mtd@...>, <dwmw2@...>, <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Sunday, October 21, 2007 - 7:12 am

On Fri, 19 October 2007 20:31:29 +0200, Peter Zijlstra wrote:

Root cause is an ordering problem in module loading.  Code flow is
roughly this:
sys_init_module
`-> load_module
:   `->	parse_args
:	`-> block2mtd_setup
:	    `-> __mutex_init
:		`-> lockdep_init_map
:		    `-> static_obj
:			`-> is_module_address
`-> __link_module

is_module_address() would return something sane, if __link_module() had
already been called.  In fact, if the parameter is passed through
/sys/modules/block2mtd/parameters/block2mtd _after_ module load time,
the exact same code works fine.  Only when passing the parameter as a
module parameter do we see this problem.

So what should be done?  We could move parse_args() below
__link_module(), but I'd guess such a change would break some other
modules what depend on certain parameters or at least should fail to
load with illegal parameters.  Do such modules exist?

Or we could add some kind of parse_args_late() that is called after
__link_module(), if requested by a module, and annotate block2mtd to
prefer that version.

[ Adding Ingo on Cc:.  Since block2mtd predates lockdep I found a bug in
  his code and not the other way around. ;) ]

Jörn

-- 
Do not stop an army on its way home.
-- Sun Tzu
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [BLOCK2MTD] WARNING: at kernel/lockdep.c:2331 lockdep_in..., Jörn, (Sun Oct 21, 7:12 am)