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