ext4: ignore e_value_offs for xattrs with value-in-ea-inode
[linux-2.6-microblaze.git] / fs / ext4 / xattr.c
index 86ed9c6..491f9ee 100644 (file)
@@ -829,6 +829,7 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
                bh = ext4_sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl, REQ_PRIO);
                if (IS_ERR(bh)) {
                        ret = PTR_ERR(bh);
+                       bh = NULL;
                        goto out;
                }
 
@@ -1695,7 +1696,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i,
 
        /* No failures allowed past this point. */
 
-       if (!s->not_found && here->e_value_size && here->e_value_offs) {
+       if (!s->not_found && here->e_value_size && !here->e_value_inum) {
                /* Remove the old value. */
                void *first_val = s->base + min_offs;
                size_t offs = le16_to_cpu(here->e_value_offs);
@@ -2903,6 +2904,7 @@ int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
                        if (error == -EIO)
                                EXT4_ERROR_INODE(inode, "block %llu read error",
                                                 EXT4_I(inode)->i_file_acl);
+                       bh = NULL;
                        goto cleanup;
                }
                error = ext4_xattr_check_block(inode, bh);
@@ -3059,6 +3061,7 @@ ext4_xattr_block_cache_find(struct inode *inode,
                if (IS_ERR(bh)) {
                        if (PTR_ERR(bh) == -ENOMEM)
                                return NULL;
+                       bh = NULL;
                        EXT4_ERROR_INODE(inode, "block %lu read error",
                                         (unsigned long)ce->e_value);
                } else if (ext4_xattr_cmp(header, BHDR(bh)) == 0) {