aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 2e3ea308c144..317ef0abccbb 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -2751,7 +2751,6 @@ static int ocfs2_xattr_ibody_set(struct inode *inode,
2751{ 2751{
2752 int ret; 2752 int ret;
2753 struct ocfs2_inode_info *oi = OCFS2_I(inode); 2753 struct ocfs2_inode_info *oi = OCFS2_I(inode);
2754 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data;
2755 struct ocfs2_xa_loc loc; 2754 struct ocfs2_xa_loc loc;
2756 2755
2757 if (inode->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE) 2756 if (inode->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE)
@@ -2759,13 +2758,6 @@ static int ocfs2_xattr_ibody_set(struct inode *inode,
2759 2758
2760 down_write(&oi->ip_alloc_sem); 2759 down_write(&oi->ip_alloc_sem);
2761 if (!(oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL)) { 2760 if (!(oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL)) {
2762 if (!ocfs2_xattr_has_space_inline(inode, di)) {
2763 ret = -ENOSPC;
2764 goto out;
2765 }
2766 }
2767
2768 if (!(oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL)) {
2769 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt); 2761 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt);
2770 if (ret) { 2762 if (ret) {
2771 if (ret != -ENOSPC) 2763 if (ret != -ENOSPC)
@@ -6499,6 +6491,16 @@ static int ocfs2_reflink_xattr_inline(struct ocfs2_xattr_reflink *args)
6499 } 6491 }
6500 6492
6501 new_oi = OCFS2_I(args->new_inode); 6493 new_oi = OCFS2_I(args->new_inode);
6494 /*
6495 * Adjust extent record count to reserve space for extended attribute.
6496 * Inline data count had been adjusted in ocfs2_duplicate_inline_data().
6497 */
6498 if (!(new_oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) &&
6499 !(ocfs2_inode_is_fast_symlink(args->new_inode))) {
6500 struct ocfs2_extent_list *el = &new_di->id2.i_list;
6501 le16_add_cpu(&el->l_count, -(inline_size /
6502 sizeof(struct ocfs2_extent_rec)));
6503 }
6502 spin_lock(&new_oi->ip_lock); 6504 spin_lock(&new_oi->ip_lock);
6503 new_oi->ip_dyn_features |= OCFS2_HAS_XATTR_FL | OCFS2_INLINE_XATTR_FL; 6505 new_oi->ip_dyn_features |= OCFS2_HAS_XATTR_FL | OCFS2_INLINE_XATTR_FL;
6504 new_di->i_dyn_features = cpu_to_le16(new_oi->ip_dyn_features); 6506 new_di->i_dyn_features = cpu_to_le16(new_oi->ip_dyn_features);