linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] avoid clobbering registers with J_ASSERT macro
@ 2007-08-17  5:54 Chris Snook
  2007-08-17  6:02 ` [RFC PATCH 1/2] jbd: " Chris Snook
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Snook @ 2007-08-17  5:54 UTC (permalink / raw)
  To: Stephen Tweedie, Andrew Morton; +Cc: linux-fsdevel, Chris Snook

The J_ASSERT() macro in jbd and jbd2 calls printk() prior to BUG().  While this 
makes it more convenient to read the assertion failure, it also clobbers 
registers, which can sometimes make debugging harder, which is clearly not the 
intended purpose.  I recently banged my head on this myself.

The following patches to jbd and jbd2 enable the printk only if 
CONFIG_JBD[2]_DEBUG is set.  Otherwise, it will simply BUG if the condition is 
violated.  This way test kernels still get the benefit of the J_ASSERT printk, 
while production kernels, which come from a more stable source base where it's 
easier to trace line numbers back to specific lines of code, simply get the BUG, 
with all registers preserved.

This is, of course, not the only way of fixing this problem, but it seems to be 
the least invasive way, which is why I'm proposing these patches.

	-- Chris

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-08-20 16:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17  5:54 [RFC PATCH 0/2] avoid clobbering registers with J_ASSERT macro Chris Snook
2007-08-17  6:02 ` [RFC PATCH 1/2] jbd: " Chris Snook
2007-08-17  6:04 ` [RFC PATCH 2/2] jbd2: " Chris Snook
2007-08-17 20:54 ` [RFC PATCH 0/2] " Andrew Morton
2007-08-20 13:18   ` Chris Snook
2007-08-20 15:22     ` Stephen C. Tweedie
2007-08-20 15:46       ` Matthew Wilcox
2007-08-20 16:19         ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).