On Thu, Dec 20, 2012 at 03:05:48PM -0800, [email protected] wrote:
> From: Stephen Boyd <[email protected]>
> Subject: lib: atomic64: initialize locks statically to fix early users
> 
> The atomic64 library uses a handful of static spin locks to implement
> atomic 64-bit operations on architectures without support for atomic
> 64-bit instructions.  Unfortunately, the spinlocks are initialized in a
> pure initcall and that is too late for the vfs namespace code which wants
> to use atomic64 operations before the initcall is run (introduced by
> 8823c07 "vfs: Add setns support for the mount namespace").
> 
> This leads to BUG messages such as:
> 
> BUG: spinlock bad magic on CPU#0, swapper/0/0
>  lock: atomic64_lock+0x240/0x400, .magic: 00000000, .owner: <none>/-1, 
> .owner_cpu: 0
> [<c001af64>] (unwind_backtrace+0x0/0xf0) from [<c02c2010>] 
> (do_raw_spin_lock+0x158/0x198)
> [<c02c2010>] (do_raw_spin_lock+0x158/0x198) from [<c04d89ec>] 
> (_raw_spin_lock_irqsave+0x4c/0x58)
> [<c04d89ec>] (_raw_spin_lock_irqsave+0x4c/0x58) from [<c02cabf0>] 
> (atomic64_add_return+0x30/0x5c)
> [<c02cabf0>] (atomic64_add_return+0x30/0x5c) from [<c0124564>] 
> (alloc_mnt_ns.clone.14+0x44/0xac)
> [<c0124564>] (alloc_mnt_ns.clone.14+0x44/0xac) from [<c0124f4c>] 
> (create_mnt_ns+0xc/0x54)
> [<c0124f4c>] (create_mnt_ns+0xc/0x54) from [<c06f31a4>] (mnt_init+0x120/0x1d4)
> [<c06f31a4>] (mnt_init+0x120/0x1d4) from [<c06f2d50>] 
> (vfs_caches_init+0xe0/0x10c)
> [<c06f2d50>] (vfs_caches_init+0xe0/0x10c) from [<c06d4798>] 
> (start_kernel+0x29c/0x300)
> [<c06d4798>] (start_kernel+0x29c/0x300) from [<80008078>] (0x80008078)
> 
> coming out early on during boot when spinlock debugging is enabled.
> 
> Fix this problem by initializing the spinlocks statically at compile time.
> 
> Signed-off-by: Stephen Boyd <[email protected]>
> Reported-by: Vaibhav Bedia <[email protected]>
> Tested-by: Vaibhav Bedia <[email protected]>
> Cc: Eric W. Biederman <[email protected]>
> Tested-by: Tony Lindgren <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: David Miller <[email protected]>
> Cc: <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> ---

As the issue this patch fixes didn't show up until 3.8-rc1, why is this
patch needed in any stable kernel tree?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to