Re: [RFC PATCH 0/2] avoid clobbering registers with J_ASSERT macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton wrote:
On Fri, 17 Aug 2007 01:54:18 -0400
Chris Snook <csnook@xxxxxxxxxx> wrote:

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.

How's about we just remove that printk?  Do

#define J_ASSERT(e) BUG_ON(e)?

The rest of the kernel seems to be able to cope with that...

Perfectly fine with me. I proposed the conditional on the grounds that someone probably had a purpose for the original J_ASSERT macro at some point in history, but if that purpose is long since obsolete, let's just get rid of it. I'll repost.

	-- Chris
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux