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/quota_global.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/quota_global.c')
-rw-r--r-- | fs/ocfs2/quota_global.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 7dbcfd7f65e6..a0b8b14cca8f 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "ocfs2_fs.h" | 16 | #include "ocfs2_fs.h" |
17 | #include "ocfs2.h" | 17 | #include "ocfs2.h" |
18 | #include "alloc.h" | 18 | #include "alloc.h" |
19 | #include "blockcheck.h" | ||
19 | #include "inode.h" | 20 | #include "inode.h" |
20 | #include "journal.h" | 21 | #include "journal.h" |
21 | #include "file.h" | 22 | #include "file.h" |
@@ -90,12 +91,20 @@ struct qtree_fmt_operations ocfs2_global_ops = { | |||
90 | static int ocfs2_validate_quota_block(struct super_block *sb, | 91 | static int ocfs2_validate_quota_block(struct super_block *sb, |
91 | struct buffer_head *bh) | 92 | struct buffer_head *bh) |
92 | { | 93 | { |
93 | struct ocfs2_disk_dqtrailer *dqt = ocfs2_dq_trailer(sb, bh->b_data); | 94 | struct ocfs2_disk_dqtrailer *dqt = |
95 | ocfs2_block_dqtrailer(sb->s_blocksize, bh->b_data); | ||
94 | 96 | ||
95 | mlog(0, "Validating quota block %llu\n", | 97 | mlog(0, "Validating quota block %llu\n", |
96 | (unsigned long long)bh->b_blocknr); | 98 | (unsigned long long)bh->b_blocknr); |
97 | 99 | ||
98 | return 0; | 100 | BUG_ON(!buffer_uptodate(bh)); |
101 | |||
102 | /* | ||
103 | * If the ecc fails, we return the error but otherwise | ||
104 | * leave the filesystem running. We know any error is | ||
105 | * local to this block. | ||
106 | */ | ||
107 | return ocfs2_validate_meta_ecc(sb, bh->b_data, &dqt->dq_check); | ||
99 | } | 108 | } |
100 | 109 | ||
101 | int ocfs2_read_quota_block(struct inode *inode, u64 v_block, | 110 | int ocfs2_read_quota_block(struct inode *inode, u64 v_block, |