From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Snook Subject: [PATCH 2/2] jbd2: remove printk() from J_ASSERT macros Date: Mon, 20 Aug 2007 10:26:06 -0400 Message-ID: <20070820142606.GB14588@shell.boston.redhat.com> References: <46C9A30E.3050103@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Andrew Morton , Stephen Tweedie Return-path: Received: from mx1.redhat.com ([66.187.233.31]:60989 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759375AbXHTO0K (ORCPT ); Mon, 20 Aug 2007 10:26:10 -0400 Content-Disposition: inline In-Reply-To: <46C9A30E.3050103@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org From: Chris Snook Remove printk from J_ASSERT to preserve registers during BUG. Signed-off-by: Chris Snook --- linux-2.6.23-rc3-orig/include/linux/jbd2.h 2007-08-13 03:14:13.000000000 -0400 +++ linux-2.6.23-rc3-patch/include/linux/jbd2.h 2007-08-20 09:55:47.000000000 -0400 @@ -255,17 +255,7 @@ typedef struct journal_superblock_s #include #include -#define JBD_ASSERTIONS -#ifdef JBD_ASSERTIONS -#define J_ASSERT(assert) \ -do { \ - if (!(assert)) { \ - printk (KERN_EMERG \ - "Assertion failure in %s() at %s:%d: \"%s\"\n", \ - __FUNCTION__, __FILE__, __LINE__, # assert); \ - BUG(); \ - } \ -} while (0) +#define J_ASSERT(assert) BUG_ON(!(assert)) #if defined(CONFIG_BUFFER_DEBUG) void buffer_assertion_failure(struct buffer_head *bh); @@ -281,10 +271,6 @@ void buffer_assertion_failure(struct buf #define J_ASSERT_JH(jh, expr) J_ASSERT(expr) #endif -#else -#define J_ASSERT(assert) do { } while (0) -#endif /* JBD_ASSERTIONS */ - #if defined(JBD_PARANOID_IOFAIL) #define J_EXPECT(expr, why...) J_ASSERT(expr) #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr)