Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / jbd-journal-chksum-2.6-sles10.patch
1 Index: linux-2.6.16.60-0.37/fs/jbd/commit.c
2 ===================================================================
3 --- linux-2.6.16.60-0.37.orig/fs/jbd/commit.c   2009-06-02 23:33:33.000000000 -0600
4 +++ linux-2.6.16.60-0.37/fs/jbd/commit.c        2009-06-02 23:33:54.000000000 -0600
5 @@ -22,6 +22,7 @@
6  #include <linux/pagemap.h>
7  #include <linux/smp_lock.h>
8  #include <linux/jiffies.h>
9 +#include <linux/crc32.h>
10  
11  /*
12   * Default IO end handler for temporary BJ_IO buffer_heads.
13 @@ -94,19 +95,23 @@
14         return 1;
15  }
16  
17 -/* Done it all: now write the commit record.  We should have
18 +/*
19 + * Done it all: now submit the commit record.  We should have
20   * cleaned up our previous buffers by now, so if we are in abort
21   * mode we can now just skip the rest of the journal write
22   * entirely.
23   *
24   * Returns 1 if the journal needs to be aborted or 0 on success
25   */
26 -static int journal_write_commit_record(journal_t *journal,
27 -                                       transaction_t *commit_transaction)
28 +static int journal_submit_commit_record(journal_t *journal,
29 +                                       transaction_t *commit_transaction,
30 +                                       struct buffer_head **cbh,
31 +                                       __u32 crc32_sum)
32  {
33         struct journal_head *descriptor;
34 +       struct commit_header *tmp;
35         struct buffer_head *bh;
36 -       int i, ret;
37 +       int ret;
38         int barrier_done = 0;
39  
40         if (is_journal_aborted(journal))
41 @@ -118,21 +123,34 @@
42  
43         bh = jh2bh(descriptor);
44  
45 -       /* AKPM: buglet - add `i' to tmp! */
46 -       for (i = 0; i < bh->b_size; i += 512) {
47 -               journal_header_t *tmp = (journal_header_t*)bh->b_data;
48 -               tmp->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER);
49 -               tmp->h_blocktype = cpu_to_be32(JFS_COMMIT_BLOCK);
50 -               tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid);
51 +       tmp = (struct commit_header *)bh->b_data;
52 +       tmp->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER);
53 +       tmp->h_blocktype = cpu_to_be32(JFS_COMMIT_BLOCK);
54 +       tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid);
55 +                               
56 +       if (JFS_HAS_COMPAT_FEATURE(journal,
57 +                               JFS_FEATURE_COMPAT_CHECKSUM)) {
58 +               tmp->h_chksum_type      = JFS_CRC32_CHKSUM;
59 +               tmp->h_chksum_size      = JFS_CRC32_CHKSUM_SIZE;
60 +               tmp->h_chksum[0]        = cpu_to_be32(crc32_sum);
61         }
62  
63 -       JBUFFER_TRACE(descriptor, "write commit block");
64 +       JBUFFER_TRACE(descriptor, "submit commit block");
65 +       lock_buffer(bh);
66 +
67         set_buffer_dirty(bh);
68 -       if (journal->j_flags & JFS_BARRIER) {
69 +       set_buffer_uptodate(bh);
70 +       bh->b_end_io = journal_end_buffer_io_sync;
71 +
72 +       if (journal->j_flags & JFS_BARRIER &&
73 +               !JFS_HAS_INCOMPAT_FEATURE(journal,
74 +                                        JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)) {
75 +
76                 set_buffer_ordered(bh);
77                 barrier_done = 1;
78         }
79 -       ret = sync_dirty_buffer(bh);
80 +       ret = submit_bh(WRITE, bh);
81 +
82         if (barrier_done)
83                 clear_buffer_ordered(bh);
84         /* is it possible for another commit to fail at roughly
85 @@ -154,12 +172,84 @@
86                 /* And try again, without the barrier */
87                 set_buffer_uptodate(bh);
88                 set_buffer_dirty(bh);
89 -               ret = sync_dirty_buffer(bh);
90 +               ret = submit_bh(WRITE, bh);
91         }
92 -       put_bh(bh);             /* One for getblk() */
93 -       journal_put_journal_head(descriptor);
94 +       *cbh = bh;
95 +       return ret;
96 +}
97  
98 -       return (ret == -EIO);
99 +/*
100 + * This function along with journal_submit_commit_record
101 + * allows to write the commit record asynchronously.
102 + */
103 +static int journal_wait_on_commit_record(struct buffer_head *bh)
104 +{
105 +       int ret = 0;
106 +
107 +       clear_buffer_dirty(bh);
108 +       wait_on_buffer(bh);
109 +       
110 +       if (unlikely(!buffer_uptodate(bh)))
111 +               ret = -EIO;
112 +       put_bh(bh);            /* One for getblk() */
113 +       journal_put_journal_head(bh2jh(bh));
114 +       
115 +       return ret;
116 +}
117 +
118 +/*
119 + * Wait for all submitted IO to complete.
120 + */
121 +static int journal_wait_on_locked_list(journal_t *journal,
122 +                                      transaction_t *commit_transaction)
123 +{
124 +       int ret = 0;
125 +       struct journal_head *jh;
126 +
127 +       while (commit_transaction->t_locked_list) {
128 +               struct buffer_head *bh;
129 +
130 +               jh = commit_transaction->t_locked_list->b_tprev;
131 +               bh = jh2bh(jh);
132 +               get_bh(bh);
133 +               if (buffer_locked(bh)) {
134 +                       spin_unlock(&journal->j_list_lock);
135 +                       wait_on_buffer(bh);
136 +                       if (unlikely(!buffer_uptodate(bh)))
137 +                               ret = -EIO;
138 +                       spin_lock(&journal->j_list_lock);
139 +               }
140 +               if (!inverted_lock(journal, bh)) {
141 +                       put_bh(bh);
142 +                       spin_lock(&journal->j_list_lock);
143 +                       continue;
144 +               }
145 +               if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
146 +                       __journal_unfile_buffer(jh);
147 +                       jbd_unlock_bh_state(bh);
148 +                       journal_remove_journal_head(bh);
149 +                       put_bh(bh);
150 +               } else {
151 +                       jbd_unlock_bh_state(bh);
152 +               }
153 +               put_bh(bh);
154 +               cond_resched_lock(&journal->j_list_lock);
155 +       }
156 +       return ret;
157 +}
158 +
159 +static inline __u32 jbd_checksum_data(__u32 crc32_sum, struct buffer_head *bh)
160 +{
161 +       struct page *page = bh->b_page;
162 +       char *addr;
163 +       __u32 checksum;
164 +
165 +       addr = kmap_atomic(page, KM_USER0);
166 +       checksum = crc32_be(crc32_sum,
167 +                           (void *)(addr + offset_in_page(bh->b_data)),
168 +                           bh->b_size);
169 +       kunmap_atomic(addr, KM_USER0);
170 +       return checksum;
171  }
172  
173  void journal_do_submit_data(struct buffer_head **wbuf, int bufs)
174 @@ -296,6 +386,8 @@
175         int first_tag = 0;
176         int tag_flag;
177         int i;
178 +       struct buffer_head *cbh = NULL; /* For transactional checksums */
179 +       __u32 crc32_sum = ~0;
180  
181         /*
182          * First job: lock down the current transaction and wait for
183 @@ -439,38 +531,15 @@
184         journal_submit_data_buffers(journal, commit_transaction);
185  
186         /*
187 -        * Wait for all previously submitted IO to complete.
188 +        * Wait for all previously submitted IO to complete if commit
189 +        * record is to be written synchronously.
190          */
191         spin_lock(&journal->j_list_lock);
192 -       while (commit_transaction->t_locked_list) {
193 -               struct buffer_head *bh;
194 +       if (!JFS_HAS_INCOMPAT_FEATURE(journal,
195 +               JFS_FEATURE_INCOMPAT_ASYNC_COMMIT))
196 +               err = journal_wait_on_locked_list(journal,
197 +                                                 commit_transaction);
198  
199 -               jh = commit_transaction->t_locked_list->b_tprev;
200 -               bh = jh2bh(jh);
201 -               get_bh(bh);
202 -               if (buffer_locked(bh)) {
203 -                       spin_unlock(&journal->j_list_lock);
204 -                       wait_on_buffer(bh);
205 -                       if (unlikely(!buffer_uptodate(bh)))
206 -                               err = -EIO;
207 -                       spin_lock(&journal->j_list_lock);
208 -               }
209 -               if (!inverted_lock(journal, bh)) {
210 -                       put_bh(bh);
211 -                       spin_lock(&journal->j_list_lock);
212 -                       continue;
213 -               }
214 -               if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
215 -                       __journal_unfile_buffer(jh);
216 -                       jbd_unlock_bh_state(bh);
217 -                       journal_remove_journal_head(bh);
218 -                       put_bh(bh);
219 -               } else {
220 -                       jbd_unlock_bh_state(bh);
221 -               }
222 -               put_bh(bh);
223 -               cond_resched_lock(&journal->j_list_lock);
224 -       }
225         spin_unlock(&journal->j_list_lock);
226  
227         if (err)
228 @@ -643,6 +712,16 @@
229  start_journal_io:
230                         for (i = 0; i < bufs; i++) {
231                                 struct buffer_head *bh = wbuf[i];
232 +                               /*
233 +                                * Compute checksum.
234 +                                */
235 +                               if (JFS_HAS_COMPAT_FEATURE(journal,
236 +                                       JFS_FEATURE_COMPAT_CHECKSUM)) {
237 +                                       crc32_sum =
238 +                                               jbd_checksum_data(crc32_sum,
239 +                                                                  bh);
240 +                               }
241 +
242                                 lock_buffer(bh);
243                                 clear_buffer_dirty(bh);
244                                 set_buffer_uptodate(bh);
245 @@ -659,6 +738,23 @@
246                 }
247         }
248  
249 +       /* Done it all: now write the commit record asynchronously. */
250 +
251 +       if (JFS_HAS_INCOMPAT_FEATURE(journal,
252 +               JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)) {
253 +               err = journal_submit_commit_record(journal, commit_transaction,
254 +                                                &cbh, crc32_sum);
255 +               if (err)
256 +                       __journal_abort_hard(journal);
257 +
258 +               spin_lock(&journal->j_list_lock);
259 +               err = journal_wait_on_locked_list(journal,
260 +                                               commit_transaction);
261 +               spin_unlock(&journal->j_list_lock);
262 +               if (err)
263 +                       __journal_abort_hard(journal);
264 +       }
265 +
266         /* Lo and behold: we have just managed to send a transaction to
267             the log.  Before we can commit it, wait for the IO so far to
268             complete.  Control buffers being written are on the
269 @@ -757,9 +853,15 @@
270         }
271  
272         jbd_debug(3, "JBD: commit phase 6\n");
273 -
274 -       if (journal_write_commit_record(journal, commit_transaction))
275 -               err = -EIO;
276 +               
277 +       if (!JFS_HAS_INCOMPAT_FEATURE(journal,
278 +               JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)) {
279 +               err = journal_submit_commit_record(journal, commit_transaction,
280 +                                               &cbh, crc32_sum);
281 +               if (err)
282 +                       __journal_abort_hard(journal);
283 +       }
284 +       err = journal_wait_on_commit_record(cbh);
285  
286         if (err)
287                 __journal_abort_hard(journal);
288 Index: linux-2.6.16.60-0.37/fs/jbd/recovery.c
289 ===================================================================
290 --- linux-2.6.16.60-0.37.orig/fs/jbd/recovery.c 2006-03-19 22:53:29.000000000 -0700
291 +++ linux-2.6.16.60-0.37/fs/jbd/recovery.c      2009-06-02 23:33:54.000000000 -0600
292 @@ -21,6 +21,7 @@
293  #include <linux/jbd.h>
294  #include <linux/errno.h>
295  #include <linux/slab.h>
296 +#include <linux/crc32.h>
297  #endif
298  
299  /*
300 @@ -307,6 +308,38 @@
301         return err;
302  }
303  
304 +/*
305 + * calc_chksums calculates the checksums for the blocks described in the
306 + * descriptor block.
307 + */
308 +static int calc_chksums(journal_t *journal, struct buffer_head *bh,
309 +                      unsigned long *next_log_block, __u32 *crc32_sum)
310 +{
311 +       int i, num_blks, err;
312 +       unsigned long io_block;
313 +       struct buffer_head *obh;
314 +
315 +       num_blks = count_tags(bh, journal->j_blocksize);
316 +       /* Calculate checksum of the descriptor block. */
317 +       *crc32_sum = crc32_be(*crc32_sum, (void *)bh->b_data, bh->b_size);
318 +
319 +       for (i = 0; i < num_blks; i++) {
320 +               io_block = (*next_log_block)++;
321 +               wrap(journal, *next_log_block);
322 +               err = jread(&obh, journal, io_block);
323 +               if (err) {
324 +                       printk(KERN_ERR "JBD: IO error %d recovering block "
325 +                               "%lu in log\n", err, io_block);
326 +                       return 1;
327 +               } else {
328 +                       *crc32_sum = crc32_be(*crc32_sum, (void *)obh->b_data,
329 +                                    obh->b_size);
330 +               }
331 +               put_bh(obh);
332 +       }
333 +       return 0;
334 +}
335 +
336  static int do_one_pass(journal_t *journal,
337                         struct recovery_info *info, enum passtype pass)
338  {
339 @@ -318,6 +351,7 @@
340         struct buffer_head *    bh;
341         unsigned int            sequence;
342         int                     blocktype;
343 +       __u32                   crc32_sum = ~0; /* Transactional Checksums */
344  
345         /* Precompute the maximum metadata descriptors in a descriptor block */
346         int                     MAX_BLOCKS_PER_DESC;
347 @@ -409,9 +443,24 @@
348                 switch(blocktype) {
349                 case JFS_DESCRIPTOR_BLOCK:
350                         /* If it is a valid descriptor block, replay it
351 -                        * in pass REPLAY; otherwise, just skip over the
352 -                        * blocks it describes. */
353 +                        * in pass REPLAY; if journal_checksums enabled, then
354 +                        * calculate checksums in PASS_SCAN, otherwise,
355 +                        * just skip over the blocks it describes. */
356                         if (pass != PASS_REPLAY) {
357 +                               if (pass == PASS_SCAN &&
358 +                                   JFS_HAS_COMPAT_FEATURE(journal,
359 +                                           JFS_FEATURE_COMPAT_CHECKSUM) &&
360 +                                   !info->end_transaction) {
361 +                                       if (calc_chksums(journal, bh,
362 +                                                       &next_log_block,
363 +                                                       &crc32_sum)) {
364 +                                               put_bh(bh);
365 +                                               break;
366 +                                       }
367 +                                       put_bh(bh);
368 +                                       continue;
369 +                               }
370 +
371                                 next_log_block +=
372                                         count_tags(bh, journal->j_blocksize);
373                                 wrap(journal, next_log_block);
374 @@ -506,9 +555,97 @@
375                         continue;
376  
377                 case JFS_COMMIT_BLOCK:
378 -                       /* Found an expected commit block: not much to
379 -                        * do other than move on to the next sequence
380 +                       /*     How to differentiate between interrupted commit
381 +                        *               and journal corruption ?
382 +                        *
383 +                        * {nth transaction}
384 +                        *        Checksum Verification Failed
385 +                        *                       |
386 +                        *               ____________________
387 +                        *              |                    |
388 +                        *      async_commit             sync_commit
389 +                        *              |                    |
390 +                        *              | GO TO NEXT    "Journal Corruption"
391 +                        *              | TRANSACTION
392 +                        *              |
393 +                        * {(n+1)th transanction}
394 +                        *              |
395 +                        *       _______|______________
396 +                        *      |                     |
397 +                        * Commit block found   Commit block not found
398 +                        *      |                     |
399 +                        * "Journal Corruption"       |
400 +                        *               _____________|__________
401 +                        *              |                       |
402 +                        *      nth trans corrupt       OR   nth trans
403 +                        *      and (n+1)th interrupted     interrupted 
404 +                        *      before commit block
405 +                        *      could reach the disk.
406 +                        *      (Cannot find the difference in above
407 +                        *       mentioned conditions. Hence assume
408 +                        *       "Interrupted Commit".)
409 +                        */
410 +
411 +                       /* Found an expected commit block: if checksums
412 +                        * are present verify them in PASS_SCAN; else not
413 +                        * much to do other than move on to the next sequence
414                          * number. */
415 +                       if (pass == PASS_SCAN &&
416 +                           JFS_HAS_COMPAT_FEATURE(journal,
417 +                                   JFS_FEATURE_COMPAT_CHECKSUM)) {
418 +                               int chksum_err, chksum_seen;
419 +                               struct commit_header *cbh =
420 +                                       (struct commit_header *)bh->b_data;
421 +                               unsigned found_chksum =
422 +                                               be32_to_cpu(cbh->h_chksum[0]);
423 +
424 +                               chksum_err = chksum_seen = 0;
425 +
426 +                               if (info->end_transaction) {
427 +                                       printk(KERN_ERR "JBD: Transaction %u "
428 +                                               "found to be corrupt.\n",
429 +                                               next_commit_ID - 1);
430 +                                       brelse(bh);
431 +                                       break;
432 +                               }
433 +
434 +                               if (crc32_sum == found_chksum &&
435 +                                   cbh->h_chksum_type == JFS_CRC32_CHKSUM &&
436 +                                   cbh->h_chksum_size ==
437 +                                               JFS_CRC32_CHKSUM_SIZE) {
438 +                                      chksum_seen = 1;
439 +                               } else if (!(cbh->h_chksum_type == 0 &&
440 +                                            cbh->h_chksum_size == 0 &&
441 +                                            found_chksum == 0 &&
442 +                                            !chksum_seen)) {
443 +                               /*
444 +                                * If fs is mounted using an old kernel and then
445 +                                * kernel with journal_chksum is used then we
446 +                                * get a situation where the journal flag has
447 +                                * checksum flag set but checksums are not
448 +                                * present i.e chksum = 0, in the individual
449 +                                * commit blocks.
450 +                                * Hence to avoid checksum failures, in this
451 +                                * situation, this extra check is added.
452 +                                */
453 +                                               chksum_err = 1;
454 +                               }
455 +
456 +                               if (chksum_err) {
457 +                                       info->end_transaction = next_commit_ID;
458 +
459 +                                       if (!JFS_HAS_INCOMPAT_FEATURE(journal,
460 +                                           JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)){
461 +                                               printk(KERN_ERR
462 +                                                      "JBD: Transaction %u "
463 +                                                      "found to be corrupt.\n",
464 +                                                      next_commit_ID);
465 +                                               brelse(bh);
466 +                                               break;
467 +                                       }
468 +                               }
469 +                               crc32_sum = ~0;
470 +                       }
471                         brelse(bh);
472                         next_commit_ID++;
473                         continue;
474 @@ -543,9 +680,10 @@
475          * transaction marks the end of the valid log.
476          */
477  
478 -       if (pass == PASS_SCAN)
479 -               info->end_transaction = next_commit_ID;
480 -       else {
481 +       if (pass == PASS_SCAN) {
482 +               if (!info->end_transaction)
483 +                       info->end_transaction = next_commit_ID;
484 +       } else {
485                 /* It's really bad news if different passes end up at
486                  * different places (but possible due to IO errors). */
487                 if (info->end_transaction != next_commit_ID) {
488 Index: linux-2.6.16.60-0.37/fs/jbd/journal.c
489 ===================================================================
490 --- linux-2.6.16.60-0.37.orig/fs/jbd/journal.c  2009-06-02 23:33:33.000000000 -0600
491 +++ linux-2.6.16.60-0.37/fs/jbd/journal.c       2009-06-02 23:33:54.000000000 -0600
492 @@ -64,6 +64,7 @@
493  EXPORT_SYMBOL(journal_check_used_features);
494  EXPORT_SYMBOL(journal_check_available_features);
495  EXPORT_SYMBOL(journal_set_features);
496 +EXPORT_SYMBOL(journal_clear_features);
497  EXPORT_SYMBOL(journal_create);
498  EXPORT_SYMBOL(journal_load);
499  EXPORT_SYMBOL(journal_destroy);
500 @@ -1565,6 +1566,33 @@
501         return 1;
502  }
503  
504 +/**
505 + * int journal_clear_features () - Clear a given journal feature in the superblock
506 + * @journal: Journal to act on.
507 + * @compat: bitmask of compatible features
508 + * @ro: bitmask of features that force read-only mount
509 + * @incompat: bitmask of incompatible features
510 + *
511 + * Clear a given journal feature as present on the
512 + * superblock.  Returns true if the requested features could be reset.
513 + *
514 + */
515 +int journal_clear_features (journal_t *journal, unsigned long compat,
516 +                         unsigned long ro, unsigned long incompat)
517 +{
518 +       journal_superblock_t *sb;
519 +
520 +       jbd_debug(1, "Clear features 0x%lx/0x%lx/0x%lx\n",
521 +                 compat, ro, incompat);
522 +
523 +       sb = journal->j_superblock;
524 +
525 +       sb->s_feature_compat    &= ~cpu_to_be32(compat);
526 +       sb->s_feature_ro_compat &= ~cpu_to_be32(ro);
527 +       sb->s_feature_incompat  &= ~cpu_to_be32(incompat);
528 +
529 +       return 1;
530 +}
531  
532  /**
533   * int journal_update_format () - Update on-disk journal structure.
534 Index: linux-2.6.16.60-0.37/fs/Kconfig
535 ===================================================================
536 --- linux-2.6.16.60-0.37.orig/fs/Kconfig        2009-03-24 05:46:35.000000000 -0700
537 +++ linux-2.6.16.60-0.37/fs/Kconfig     2009-06-02 23:33:54.000000000 -0600
538 @@ -140,6 +140,7 @@
539  
540  config JBD
541         tristate
542 +       select CRC32
543         help
544           This is a generic journaling layer for block devices.  It is
545           currently used by the ext3 and OCFS2 file systems, but it could
546 Index: linux-2.6.16.60-0.37/include/linux/jbd.h
547 ===================================================================
548 --- linux-2.6.16.60-0.37.orig/include/linux/jbd.h       2009-06-02 23:33:33.000000000 -0600
549 +++ linux-2.6.16.60-0.37/include/linux/jbd.h    2009-06-02 23:33:54.000000000 -0600
550 @@ -142,6 +142,29 @@
551         __be32          h_sequence;
552  } journal_header_t;
553  
554 +/*
555 + * Checksum types.
556 + */
557 +#define JFS_CRC32_CHKSUM   1
558 +#define JFS_MD5_CHKSUM     2
559 +#define JFS_SHA1_CHKSUM    3
560 +
561 +#define JFS_CRC32_CHKSUM_SIZE 4
562 +
563 +#define JFS_CHECKSUM_BYTES (32 / sizeof(u32))
564 +/*
565 + * Commit block header for storing transactional checksums:
566 + */
567 +struct commit_header
568 +{
569 +       __be32          h_magic;
570 +       __be32          h_blocktype;
571 +       __be32          h_sequence;
572 +       unsigned char   h_chksum_type;
573 +       unsigned char   h_chksum_size;
574 +       unsigned char   h_padding[2];
575 +       __be32          h_chksum[JFS_CHECKSUM_BYTES];
576 +};
577  
578  /* 
579   * The block tag: used to describe a single buffer in the journal 
580 @@ -228,12 +251,16 @@
581         ((j)->j_format_version >= 2 &&                                  \
582          ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
583  
584 -#define JFS_FEATURE_INCOMPAT_REVOKE    0x00000001
585 +#define JFS_FEATURE_COMPAT_CHECKSUM    0x00000001
586 +
587 +#define JFS_FEATURE_INCOMPAT_REVOKE            0x00000001
588 +#define JFS_FEATURE_INCOMPAT_ASYNC_COMMIT      0x00000004
589  
590  /* Features known to this kernel version: */
591 -#define JFS_KNOWN_COMPAT_FEATURES      0
592 +#define JFS_KNOWN_COMPAT_FEATURES      JFS_FEATURE_COMPAT_CHECKSUM
593  #define JFS_KNOWN_ROCOMPAT_FEATURES    0
594 -#define JFS_KNOWN_INCOMPAT_FEATURES    JFS_FEATURE_INCOMPAT_REVOKE
595 +#define JFS_KNOWN_INCOMPAT_FEATURES    (JFS_FEATURE_INCOMPAT_REVOKE | \
596 +                                       JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)
597  
598  #ifdef __KERNEL__
599  
600 @@ -1041,6 +1068,8 @@
601                    (journal_t *, unsigned long, unsigned long, unsigned long);
602  extern int        journal_set_features 
603                    (journal_t *, unsigned long, unsigned long, unsigned long);
604 +extern int        journal_clear_features
605 +                  (journal_t *, unsigned long, unsigned long, unsigned long);
606  extern int        journal_create     (journal_t *);
607  extern int        journal_load       (journal_t *journal);
608  extern void       journal_destroy    (journal_t *);
609 Index: linux-2.6.16.60-0.37/Documentation/filesystems/ext3.txt
610 ===================================================================
611 --- linux-2.6.16.60-0.37.orig/Documentation/filesystems/ext3.txt        2006-03-19 22:53:29.000000000 -0700
612 +++ linux-2.6.16.60-0.37/Documentation/filesystems/ext3.txt     2009-06-02 23:33:54.000000000 -0600
613 @@ -14,6 +14,16 @@
614  When mounting an ext3 filesystem, the following option are accepted:
615  (*) == default
616  
617 +journal_checksum       Enable checksumming of the journal transactions.
618 +                       This will allow the recovery code in e2fsck and the
619 +                       kernel to detect corruption in the kernel.  It is a
620 +                       compatible change and will be ignored by older kernels.
621 +
622 +journal_async_commit   Commit block can be written to disk without waiting
623 +                       for descriptor blocks. If enabled older kernels cannot
624 +                       mount the device. This will enable 'journal_checksum'
625 +                       internally.
626 +
627  journal=update         Update the ext3 file system's journal to the current
628                         format.
629