diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-12-05 11:19:37 -0800 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-12-16 14:15:34 -0800 |
commit | 70a6e2c5799786fb24270d12b9434ba2ba62dfbc (patch) | |
tree | d39b9aaf72201fd4dcd200eef1896ab44052a714 /fs | |
parent | 1f05472a72bea5fad83d88f2a22bac2e311cf917 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/xattr.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 8a82bcc7e647..37054372f40d 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]); } @@ -3080,7 +3093,7 @@ static int ocfs2_iterate_xattr_buckets(struct inode *inode, if (func) { ret = func(inode, bucket, para); if (ret) - mlog_errno(ret); + mlog_errno(ret); /* Fall through to bucket_relse() */ } |