From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Snook Subject: [RFC PATCH 2/2] jbd2: avoid clobbering registers with J_ASSERT macro Date: Fri, 17 Aug 2007 02:04:57 -0400 Message-ID: <20070817060457.GB25621@shell.boston.redhat.com> References: <46C5380A.8080109@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Stephen Tweedie , Andrew Morton Return-path: Received: from mx1.redhat.com ([66.187.233.31]:56973 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756885AbXHQGFD (ORCPT ); Fri, 17 Aug 2007 02:05:03 -0400 Content-Disposition: inline In-Reply-To: <46C5380A.8080109@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org From: Chris Snook Don't printk before BUG in J_ASSERT unless CONFIG_JBD2_DEBUG is set. 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-17 01:44:34.000000000 -0400 @@ -255,7 +255,10 @@ typedef struct journal_superblock_s #include #include +#ifdef CONFIG_JBD2_DEBUG #define JBD_ASSERTIONS +#endif + #ifdef JBD_ASSERTIONS #define J_ASSERT(assert) \ do { \ @@ -282,7 +285,7 @@ void buffer_assertion_failure(struct buf #endif #else -#define J_ASSERT(assert) do { } while (0) +#define J_ASSERT(assert) BUG_ON(!(assert)) #endif /* JBD_ASSERTIONS */ #if defined(JBD_PARANOID_IOFAIL)