Whamcloud - gitweb
file xnu_types.h was initially added on branch b_port_step.
[fs/lustre-release.git] / lustre / kernel_patches / patches / jbd-get_write_access.patch
1 diff -rup linux-2.4.20-uml/fs/jbd/transaction.c linux-2.4.21-rc2/fs/jbd/transaction.c
2 --- linux-2.4.20-uml/fs/jbd/transaction.c       Thu Nov 28 16:53:15 2002
3 +++ linux-2.4.21-rc2/fs/jbd/transaction.c       Fri May 16 11:00:40 2003
4 @@ -735,7 +743,8 @@ done_locked:
5                 int offset;
6                 char *source;
7  
8 -               J_ASSERT_JH(jh, buffer_uptodate(jh2bh(jh)));
9 +               J_EXPECT_JH(jh, buffer_uptodate(jh2bh(jh)),
10 +                           "Possible IO failure.\n");
11                 page = jh2bh(jh)->b_page;
12                 offset = ((unsigned long) jh2bh(jh)->b_data) & ~PAGE_MASK;
13                 source = kmap(page);
14 diff -rup linux-2.4.20-uml/include/linux/jbd.h linux-2.4.21-rc2/include/linux/jbd.h
15 --- linux-2.4.20-uml/include/linux/jbd.h        Mon Aug 25 16:16:57 2003
16 +++ linux-2.4.21-rc2/include/linux/jbd.h        Tue May 13 13:28:29 2003
17 @@ -40,6 +40,15 @@
18   */
19  #undef JBD_PARANOID_WRITES
20  
21 +/*
22 + * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds
23 + * certain classes of error which can occur due to failed IOs.  Under
24 + * normal use we want ext3 to continue after such errors, because
25 + * hardware _can_ fail, but for debugging purposes when running tests on
26 + * known-good hardware we may want to trap these errors.
27 + */
28 +#undef JBD_PARANOID_IOFAIL
29 +
30  #ifdef CONFIG_JBD_DEBUG
31  /*
32   * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
33 @@ -232,6 +272,23 @@ void buffer_assertion_failure(struct buf
34  #define J_ASSERT(assert)       do { } while (0)
35  #endif         /* JBD_ASSERTIONS */
36  
37 +#if defined(JBD_PARANOID_IOFAIL)
38 +#define J_EXPECT(expr, why...)         J_ASSERT(expr)
39 +#define J_EXPECT_BH(bh, expr, why...)  J_ASSERT_BH(bh, expr)
40 +#define J_EXPECT_JH(jh, expr, why...)  J_ASSERT_JH(jh, expr)
41 +#else
42 +#define __journal_expect(expr, why...)                                      \
43 +       do {                                                                 \
44 +               if (!(expr)) {                                               \
45 +                       printk(KERN_ERR "EXT3-fs unexpected failure: %s;\n", # expr); \
46 +                       printk(KERN_ERR why);                                \
47 +               }                                                            \
48 +       } while (0)
49 +#define J_EXPECT(expr, why...)         __journal_expect(expr, ## why)
50 +#define J_EXPECT_BH(bh, expr, why...)  __journal_expect(expr, ## why)
51 +#define J_EXPECT_JH(jh, expr, why...)  __journal_expect(expr, ## why)
52 +#endif
53 +
54  enum jbd_state_bits {
55         BH_JWrite
56           = BH_PrivateStart,    /* 1 if being written to log (@@@ DEBUGGING) */