aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.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/xattr.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/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index dfc51c305bb9..bc822d6ba542 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -42,6 +42,7 @@
42 42
43#include "ocfs2.h" 43#include "ocfs2.h"
44#include "alloc.h" 44#include "alloc.h"
45#include "blockcheck.h"
45#include "dlmglue.h" 46#include "dlmglue.h"
46#include "file.h" 47#include "file.h"
47#include "symlink.h" 48#include "symlink.h"
@@ -322,12 +323,28 @@ static void ocfs2_xattr_bucket_copy_data(struct ocfs2_xattr_bucket *dest,
322static int ocfs2_validate_xattr_block(struct super_block *sb, 323static int ocfs2_validate_xattr_block(struct super_block *sb,
323 struct buffer_head *bh) 324 struct buffer_head *bh)
324{ 325{
326 int rc;
325 struct ocfs2_xattr_block *xb = 327 struct ocfs2_xattr_block *xb =
326 (struct ocfs2_xattr_block *)bh->b_data; 328 (struct ocfs2_xattr_block *)bh->b_data;
327 329
328 mlog(0, "Validating xattr block %llu\n", 330 mlog(0, "Validating xattr block %llu\n",
329 (unsigned long long)bh->b_blocknr); 331 (unsigned long long)bh->b_blocknr);
330 332
333 BUG_ON(!buffer_uptodate(bh));
334
335 /*
336 * If the ecc fails, we return the error but otherwise
337 * leave the filesystem running. We know any error is
338 * local to this block.
339 */
340 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &xb->xb_check);
341 if (rc)
342 return rc;
343
344 /*
345 * Errors after here are fatal
346 */
347
331 if (!OCFS2_IS_VALID_XATTR_BLOCK(xb)) { 348 if (!OCFS2_IS_VALID_XATTR_BLOCK(xb)) {
332 ocfs2_error(sb, 349 ocfs2_error(sb,
333 "Extended attribute block #%llu has bad " 350 "Extended attribute block #%llu has bad "