summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-12-05 22:19:37 +0300
committerMark Fasheh <mfasheh@suse.com>2009-01-05 19:40:32 +0300
commit4d0e214ee83185fcaa2cb97cd026d32bdc5c994a (patch)
tree7e5c2a6a2f2a384a0ebc0804f126a8106ad0b43f
parent13723d00e374c2a6d6ccb5af6de965e89c3e1b01 (diff)
downloadlinux-4d0e214ee83185fcaa2cb97cd026d32bdc5c994a.tar.xz
ocfs2: Add ecc and checksums to ocfs2 xattr buckets.
The xattr bucket can span multiple blocks on disk. We have wrappers for this structure in the code. We use the new multi-block ecc calls to calculate and validate the bucket. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
-rw-r--r--fs/ocfs2/xattr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index bc822d6ba542..7c2f4c9d1bd9 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -273,6 +273,15 @@ static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
rc = ocfs2_read_blocks(bucket->bu_inode, xb_blkno,
bucket->bu_blocks, bucket->bu_bhs, 0,
NULL);
+ if (!rc) {
+ rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb,
+ bucket->bu_bhs,
+ bucket->bu_blocks,
+ &bucket_xh(bucket)->xh_check);
+ if (rc)
+ mlog_errno(rc);
+ }
+
if (rc)
ocfs2_xattr_bucket_relse(bucket);
return rc;
@@ -301,6 +310,10 @@ static void ocfs2_xattr_bucket_journal_dirty(handle_t *handle,
{
int i;
+ ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb,
+ bucket->bu_bhs, bucket->bu_blocks,
+ &bucket_xh(bucket)->xh_check);
+
for (i = 0; i < bucket->bu_blocks; i++)
ocfs2_journal_dirty(handle, bucket->bu_bhs[i]);
}