diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/xattr.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index c63efb5ef136..2563df89fc2a 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -4795,19 +4795,33 @@ static int ocfs2_xattr_bucket_set_value_outside(struct inode *inode, | |||
4795 | char *val, | 4795 | char *val, |
4796 | int value_len) | 4796 | int value_len) |
4797 | { | 4797 | { |
4798 | int offset; | 4798 | int ret, offset, block_off; |
4799 | struct ocfs2_xattr_value_root *xv; | 4799 | struct ocfs2_xattr_value_root *xv; |
4800 | struct ocfs2_xattr_entry *xe = xs->here; | 4800 | struct ocfs2_xattr_entry *xe = xs->here; |
4801 | struct ocfs2_xattr_header *xh = bucket_xh(xs->bucket); | ||
4802 | void *base; | ||
4801 | 4803 | ||
4802 | BUG_ON(!xs->base || !xe || ocfs2_xattr_is_local(xe)); | 4804 | BUG_ON(!xs->base || !xe || ocfs2_xattr_is_local(xe)); |
4803 | 4805 | ||
4804 | offset = le16_to_cpu(xe->xe_name_offset) + | 4806 | ret = ocfs2_xattr_bucket_get_name_value(inode, xh, |
4805 | OCFS2_XATTR_SIZE(xe->xe_name_len); | 4807 | xe - xh->xh_entries, |
4808 | &block_off, | ||
4809 | &offset); | ||
4810 | if (ret) { | ||
4811 | mlog_errno(ret); | ||
4812 | goto out; | ||
4813 | } | ||
4806 | 4814 | ||
4807 | xv = (struct ocfs2_xattr_value_root *)(xs->base + offset); | 4815 | base = bucket_block(xs->bucket, block_off); |
4816 | xv = (struct ocfs2_xattr_value_root *)(base + offset + | ||
4817 | OCFS2_XATTR_SIZE(xe->xe_name_len)); | ||
4808 | 4818 | ||
4809 | return __ocfs2_xattr_set_value_outside(inode, handle, | 4819 | ret = __ocfs2_xattr_set_value_outside(inode, handle, |
4810 | xv, val, value_len); | 4820 | xv, val, value_len); |
4821 | if (ret) | ||
4822 | mlog_errno(ret); | ||
4823 | out: | ||
4824 | return ret; | ||
4811 | } | 4825 | } |
4812 | 4826 | ||
4813 | static int ocfs2_rm_xattr_cluster(struct inode *inode, | 4827 | static int ocfs2_rm_xattr_cluster(struct inode *inode, |