ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent()
[pandora-kernel.git] / fs / ocfs2 / xattr.c
index 194fb22..bef187b 100644 (file)
@@ -2376,16 +2376,18 @@ static int ocfs2_remove_value_outside(struct inode*inode,
                }
 
                ret = ocfs2_xattr_value_truncate(inode, vb, 0, &ctxt);
-               if (ret < 0) {
-                       mlog_errno(ret);
-                       break;
-               }
 
                ocfs2_commit_trans(osb, ctxt.handle);
                if (ctxt.meta_ac) {
                        ocfs2_free_alloc_context(ctxt.meta_ac);
                        ctxt.meta_ac = NULL;
                }
+
+               if (ret < 0) {
+                       mlog_errno(ret);
+                       break;
+               }
+
        }
 
        if (ctxt.meta_ac)
@@ -6497,6 +6499,16 @@ static int ocfs2_reflink_xattr_inline(struct ocfs2_xattr_reflink *args)
        }
 
        new_oi = OCFS2_I(args->new_inode);
+       /*
+        * Adjust extent record count to reserve space for extended attribute.
+        * Inline data count had been adjusted in ocfs2_duplicate_inline_data().
+        */
+       if (!(new_oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) &&
+           !(ocfs2_inode_is_fast_symlink(args->new_inode))) {
+               struct ocfs2_extent_list *el = &new_di->id2.i_list;
+               le16_add_cpu(&el->l_count, -(inline_size /
+                                       sizeof(struct ocfs2_extent_rec)));
+       }
        spin_lock(&new_oi->ip_lock);
        new_oi->ip_dyn_features |= OCFS2_HAS_XATTR_FL | OCFS2_INLINE_XATTR_FL;
        new_di->i_dyn_features = cpu_to_le16(new_oi->ip_dyn_features);
@@ -7187,7 +7199,7 @@ int ocfs2_init_security_and_acl(struct inode *dir,
        struct buffer_head *dir_bh = NULL;
 
        ret = ocfs2_init_security_get(inode, dir, qstr, NULL);
-       if (!ret) {
+       if (ret) {
                mlog_errno(ret);
                goto leave;
        }