aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r--fs/ocfs2/inode.c18
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,
1262int ocfs2_validate_inode_block(struct super_block *sb, 1263int 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,