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