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>
This commit is contained in:
@ -35,6 +35,7 @@
|
||||
#include "ocfs2.h"
|
||||
|
||||
#include "alloc.h"
|
||||
#include "blockcheck.h"
|
||||
#include "dlmglue.h"
|
||||
#include "inode.h"
|
||||
#include "journal.h"
|
||||
@ -250,8 +251,18 @@ int ocfs2_check_group_descriptor(struct super_block *sb,
|
||||
struct buffer_head *bh)
|
||||
{
|
||||
int rc;
|
||||
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
|
||||
|
||||
rc = ocfs2_validate_gd_self(sb, bh, 1);
|
||||
BUG_ON(!buffer_uptodate(bh));
|
||||
|
||||
/*
|
||||
* If the ecc fails, we return the error but otherwise
|
||||
* leave the filesystem running. We know any error is
|
||||
* local to this block.
|
||||
*/
|
||||
rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &gd->bg_check);
|
||||
if (!rc)
|
||||
rc = ocfs2_validate_gd_self(sb, bh, 1);
|
||||
if (!rc)
|
||||
rc = ocfs2_validate_gd_parent(sb, di, bh, 1);
|
||||
|
||||
@ -261,9 +272,27 @@ int ocfs2_check_group_descriptor(struct super_block *sb,
|
||||
static int ocfs2_validate_group_descriptor(struct super_block *sb,
|
||||
struct buffer_head *bh)
|
||||
{
|
||||
int rc;
|
||||
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
|
||||
|
||||
mlog(0, "Validating group descriptor %llu\n",
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
|
||||
BUG_ON(!buffer_uptodate(bh));
|
||||
|
||||
/*
|
||||
* If the ecc fails, we return the error but otherwise
|
||||
* leave the filesystem running. We know any error is
|
||||
* local to this block.
|
||||
*/
|
||||
rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &gd->bg_check);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/*
|
||||
* Errors after here are fatal.
|
||||
*/
|
||||
|
||||
return ocfs2_validate_gd_self(sb, bh, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user