From: Chris Snook <csnook@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Tweedie <sct@redhat.com>, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] avoid clobbering registers with J_ASSERT macro
Date: Mon, 20 Aug 2007 09:18:21 -0400 [thread overview]
Message-ID: <46C9949D.8060000@redhat.com> (raw)
In-Reply-To: <20070817135402.d7246766.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Fri, 17 Aug 2007 01:54:18 -0400
> Chris Snook <csnook@redhat.com> 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
next prev parent reply other threads:[~2007-08-20 13:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-08-20 15:22 ` Stephen C. Tweedie
2007-08-20 15:46 ` Matthew Wilcox
2007-08-20 16:19 ` Stephen C. Tweedie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46C9949D.8060000@redhat.com \
--to=csnook@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sct@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.