diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-10-17 17:55:01 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:40:31 -0500 |
commit | d6b32bbb3eae3fb787f1c33bf9f767ca1ddeb208 (patch) | |
tree | ce38de666096f571f4b1754e898729cf2d9eb435 /fs/ocfs2/alloc.c | |
parent | 684ef278377725d505aa23259ee673dab9b11851 (diff) |
ocfs2: block read meta ecc.
Add block check calls to the read_block validate functions. This is the
almost all of the read-side checking of metaecc. xattr buckets are not checked
yet. Writes are also unchecked, and so a read-write mount will quickly fail.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 84a7bd4db5da..6b27f74bb346 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -37,6 +37,7 @@ | |||
37 | 37 | ||
38 | #include "alloc.h" | 38 | #include "alloc.h" |
39 | #include "aops.h" | 39 | #include "aops.h" |
40 | #include "blockcheck.h" | ||
40 | #include "dlmglue.h" | 41 | #include "dlmglue.h" |
41 | #include "extent_map.h" | 42 | #include "extent_map.h" |
42 | #include "inode.h" | 43 | #include "inode.h" |
@@ -682,12 +683,28 @@ struct ocfs2_merge_ctxt { | |||
682 | static int ocfs2_validate_extent_block(struct super_block *sb, | 683 | static int ocfs2_validate_extent_block(struct super_block *sb, |
683 | struct buffer_head *bh) | 684 | struct buffer_head *bh) |
684 | { | 685 | { |
686 | int rc; | ||
685 | struct ocfs2_extent_block *eb = | 687 | struct ocfs2_extent_block *eb = |
686 | (struct ocfs2_extent_block *)bh->b_data; | 688 | (struct ocfs2_extent_block *)bh->b_data; |
687 | 689 | ||
688 | mlog(0, "Validating extent block %llu\n", | 690 | mlog(0, "Validating extent block %llu\n", |
689 | (unsigned long long)bh->b_blocknr); | 691 | (unsigned long long)bh->b_blocknr); |
690 | 692 | ||
693 | BUG_ON(!buffer_uptodate(bh)); | ||
694 | |||
695 | /* | ||
696 | * If the ecc fails, we return the error but otherwise | ||
697 | * leave the filesystem running. We know any error is | ||
698 | * local to this block. | ||
699 | */ | ||
700 | rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &eb->h_check); | ||
701 | if (rc) | ||
702 | return rc; | ||
703 | |||
704 | /* | ||
705 | * Errors after here are fatal. | ||
706 | */ | ||
707 | |||
691 | if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { | 708 | if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { |
692 | ocfs2_error(sb, | 709 | ocfs2_error(sb, |
693 | "Extent block #%llu has bad signature %.*s", | 710 | "Extent block #%llu has bad signature %.*s", |