diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-04-02 16:29:06 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-02 16:29:06 -0800 |
| commit | bdf6c6a6762da6d82a09e9e0dc51e4ceceed64e1 (patch) | |
| tree | 0b9ac1f198d3f83f57bb7c6d7a61c8da3ab0dba3 /include/linux/jbd.h | |
| parent | 723c6e83134f78035b93cb3e70503ad4d04a7dfa (diff) | |
[PATCH] Add less-severe assert-failure form for ext3.
From: Stephen Tweedie <sct@redhat.com>
Add a new form of assert failure in ext3 which allows us to flag events which
are *usually* bugs, but which can be legally triggered in the presence of IO
failures. Don't panic the kernel on such errors unless we've defined
#JBD_PARANOID_IOFAIL, which will normally be set only for testing purposes.
Diffstat (limited to 'include/linux/jbd.h')
| -rw-r--r-- | include/linux/jbd.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 0ffe50ade606..34bf7c8787ec 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -33,6 +33,15 @@ #define journal_oom_retry 1 +/* + * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds + * certain classes of error which can occur due to failed IOs. Under + * normal use we want ext3 to continue after such errors, because + * hardware _can_ fail, but for debugging purposes when running tests on + * known-good hardware we may want to trap these errors. + */ +#undef JBD_PARANOID_IOFAIL + #ifdef CONFIG_JBD_DEBUG /* * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal @@ -257,6 +266,23 @@ void buffer_assertion_failure(struct buffer_head *bh); #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) +#define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr) +#else +#define __journal_expect(expr, why...) \ + do { \ + if (!(expr)) { \ + printk(KERN_ERR "EXT3-fs unexpected failure: %s;\n", # expr); \ + printk(KERN_ERR ## why); \ + } \ + } while (0) +#define J_EXPECT(expr, why...) __journal_expect(expr, ## why) +#define J_EXPECT_BH(bh, expr, why...) __journal_expect(expr, ## why) +#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) +#endif + enum jbd_state_bits { BH_JBD /* Has an attached ext3 journal_head */ = BH_PrivateStart, |
