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/inode.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/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 288512c9dbc2..9370b652ab94 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "ocfs2.h" | 38 | #include "ocfs2.h" |
39 | 39 | ||
40 | #include "alloc.h" | 40 | #include "alloc.h" |
41 | #include "blockcheck.h" | ||
41 | #include "dlmglue.h" | 42 | #include "dlmglue.h" |
42 | #include "extent_map.h" | 43 | #include "extent_map.h" |
43 | #include "file.h" | 44 | #include "file.h" |
@@ -1262,7 +1263,7 @@ void ocfs2_refresh_inode(struct inode *inode, | |||
1262 | int ocfs2_validate_inode_block(struct super_block *sb, | 1263 | int ocfs2_validate_inode_block(struct super_block *sb, |
1263 | struct buffer_head *bh) | 1264 | struct buffer_head *bh) |
1264 | { | 1265 | { |
1265 | int rc = -EINVAL; | 1266 | int rc; |
1266 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; | 1267 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; |
1267 | 1268 | ||
1268 | mlog(0, "Validating dinode %llu\n", | 1269 | mlog(0, "Validating dinode %llu\n", |
@@ -1270,6 +1271,21 @@ int ocfs2_validate_inode_block(struct super_block *sb, | |||
1270 | 1271 | ||
1271 | BUG_ON(!buffer_uptodate(bh)); | 1272 | BUG_ON(!buffer_uptodate(bh)); |
1272 | 1273 | ||
1274 | /* | ||
1275 | * If the ecc fails, we return the error but otherwise | ||
1276 | * leave the filesystem running. We know any error is | ||
1277 | * local to this block. | ||
1278 | */ | ||
1279 | rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &di->i_check); | ||
1280 | if (rc) | ||
1281 | goto bail; | ||
1282 | |||
1283 | /* | ||
1284 | * Errors after here are fatal. | ||
1285 | */ | ||
1286 | |||
1287 | rc = -EINVAL; | ||
1288 | |||
1273 | if (!OCFS2_IS_VALID_DINODE(di)) { | 1289 | if (!OCFS2_IS_VALID_DINODE(di)) { |
1274 | ocfs2_error(sb, "Invalid dinode #%llu: signature = %.*s\n", | 1290 | ocfs2_error(sb, "Invalid dinode #%llu: signature = %.*s\n", |
1275 | (unsigned long long)bh->b_blocknr, 7, | 1291 | (unsigned long long)bh->b_blocknr, 7, |