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