aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/suballoc.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-10-17 17:55:01 -0400
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:31 -0500
commitd6b32bbb3eae3fb787f1c33bf9f767ca1ddeb208 (patch)
treece38de666096f571f4b1754e898729cf2d9eb435 /fs/ocfs2/suballoc.c
parent684ef278377725d505aa23259ee673dab9b11851 (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/suballoc.c')
-rw-r--r--fs/ocfs2/suballoc.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 226fe21f2608..78755766c329 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -35,6 +35,7 @@
35#include "ocfs2.h" 35#include "ocfs2.h"
36 36
37#include "alloc.h" 37#include "alloc.h"
38#include "blockcheck.h"
38#include "dlmglue.h" 39#include "dlmglue.h"
39#include "inode.h" 40#include "inode.h"
40#include "journal.h" 41#include "journal.h"
@@ -250,8 +251,18 @@ int ocfs2_check_group_descriptor(struct super_block *sb,
250 struct buffer_head *bh) 251 struct buffer_head *bh)
251{ 252{
252 int rc; 253 int rc;
254 struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
255
256 BUG_ON(!buffer_uptodate(bh));
253 257
254 rc = ocfs2_validate_gd_self(sb, bh, 1); 258 /*
259 * If the ecc fails, we return the error but otherwise
260 * leave the filesystem running. We know any error is
261 * local to this block.
262 */
263 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &gd->bg_check);
264 if (!rc)
265 rc = ocfs2_validate_gd_self(sb, bh, 1);
255 if (!rc) 266 if (!rc)
256 rc = ocfs2_validate_gd_parent(sb, di, bh, 1); 267 rc = ocfs2_validate_gd_parent(sb, di, bh, 1);
257 268
@@ -261,9 +272,27 @@ int ocfs2_check_group_descriptor(struct super_block *sb,
261static int ocfs2_validate_group_descriptor(struct super_block *sb, 272static int ocfs2_validate_group_descriptor(struct super_block *sb,
262 struct buffer_head *bh) 273 struct buffer_head *bh)
263{ 274{
275 int rc;
276 struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
277
264 mlog(0, "Validating group descriptor %llu\n", 278 mlog(0, "Validating group descriptor %llu\n",
265 (unsigned long long)bh->b_blocknr); 279 (unsigned long long)bh->b_blocknr);
266 280
281 BUG_ON(!buffer_uptodate(bh));
282
283 /*
284 * If the ecc fails, we return the error but otherwise
285 * leave the filesystem running. We know any error is
286 * local to this block.
287 */
288 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &gd->bg_check);
289 if (rc)
290 return rc;
291
292 /*
293 * Errors after here are fatal.
294 */
295
267 return ocfs2_validate_gd_self(sb, bh, 0); 296 return ocfs2_validate_gd_self(sb, bh, 0);
268} 297}
269 298