diff options
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 93a00d89a220..e88748e55c0f 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -82,8 +82,8 @@ | |||
82 | printk("\n"); \ | 82 | printk("\n"); \ |
83 | } while (0) | 83 | } while (0) |
84 | #else | 84 | #else |
85 | # define ea_idebug(f...) | 85 | # define ea_idebug(inode, fmt, ...) no_printk(fmt, ##__VA_ARGS__) |
86 | # define ea_bdebug(f...) | 86 | # define ea_bdebug(bh, fmt, ...) no_printk(fmt, ##__VA_ARGS__) |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | static void ext4_xattr_cache_insert(struct buffer_head *); | 89 | static void ext4_xattr_cache_insert(struct buffer_head *); |
@@ -158,13 +158,10 @@ ext4_xattr_check_names(struct ext4_xattr_entry *entry, void *end) | |||
158 | static inline int | 158 | static inline int |
159 | ext4_xattr_check_block(struct buffer_head *bh) | 159 | ext4_xattr_check_block(struct buffer_head *bh) |
160 | { | 160 | { |
161 | int error; | ||
162 | |||
163 | if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || | 161 | if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || |
164 | BHDR(bh)->h_blocks != cpu_to_le32(1)) | 162 | BHDR(bh)->h_blocks != cpu_to_le32(1)) |
165 | return -EIO; | 163 | return -EIO; |
166 | error = ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size); | 164 | return ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size); |
167 | return error; | ||
168 | } | 165 | } |
169 | 166 | ||
170 | static inline int | 167 | static inline int |
@@ -220,7 +217,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name, | |||
220 | error = -ENODATA; | 217 | error = -ENODATA; |
221 | if (!EXT4_I(inode)->i_file_acl) | 218 | if (!EXT4_I(inode)->i_file_acl) |
222 | goto cleanup; | 219 | goto cleanup; |
223 | ea_idebug(inode, "reading block %u", EXT4_I(inode)->i_file_acl); | 220 | ea_idebug(inode, "reading block %llu", |
221 | (unsigned long long)EXT4_I(inode)->i_file_acl); | ||
224 | bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); | 222 | bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); |
225 | if (!bh) | 223 | if (!bh) |
226 | goto cleanup; | 224 | goto cleanup; |
@@ -363,7 +361,8 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size) | |||
363 | error = 0; | 361 | error = 0; |
364 | if (!EXT4_I(inode)->i_file_acl) | 362 | if (!EXT4_I(inode)->i_file_acl) |
365 | goto cleanup; | 363 | goto cleanup; |
366 | ea_idebug(inode, "reading block %u", EXT4_I(inode)->i_file_acl); | 364 | ea_idebug(inode, "reading block %llu", |
365 | (unsigned long long)EXT4_I(inode)->i_file_acl); | ||
367 | bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); | 366 | bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); |
368 | error = -EIO; | 367 | error = -EIO; |
369 | if (!bh) | 368 | if (!bh) |
@@ -487,18 +486,19 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode, | |||
487 | ext4_free_blocks(handle, inode, bh, 0, 1, | 486 | ext4_free_blocks(handle, inode, bh, 0, 1, |
488 | EXT4_FREE_BLOCKS_METADATA | | 487 | EXT4_FREE_BLOCKS_METADATA | |
489 | EXT4_FREE_BLOCKS_FORGET); | 488 | EXT4_FREE_BLOCKS_FORGET); |
489 | unlock_buffer(bh); | ||
490 | } else { | 490 | } else { |
491 | le32_add_cpu(&BHDR(bh)->h_refcount, -1); | 491 | le32_add_cpu(&BHDR(bh)->h_refcount, -1); |
492 | if (ce) | ||
493 | mb_cache_entry_release(ce); | ||
494 | unlock_buffer(bh); | ||
492 | error = ext4_handle_dirty_metadata(handle, inode, bh); | 495 | error = ext4_handle_dirty_metadata(handle, inode, bh); |
493 | if (IS_SYNC(inode)) | 496 | if (IS_SYNC(inode)) |
494 | ext4_handle_sync(handle); | 497 | ext4_handle_sync(handle); |
495 | dquot_free_block(inode, 1); | 498 | dquot_free_block(inode, 1); |
496 | ea_bdebug(bh, "refcount now=%d; releasing", | 499 | ea_bdebug(bh, "refcount now=%d; releasing", |
497 | le32_to_cpu(BHDR(bh)->h_refcount)); | 500 | le32_to_cpu(BHDR(bh)->h_refcount)); |
498 | if (ce) | ||
499 | mb_cache_entry_release(ce); | ||
500 | } | 501 | } |
501 | unlock_buffer(bh); | ||
502 | out: | 502 | out: |
503 | ext4_std_error(inode->i_sb, error); | 503 | ext4_std_error(inode->i_sb, error); |
504 | return; | 504 | return; |
@@ -834,7 +834,8 @@ inserted: | |||
834 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) | 834 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |
835 | BUG_ON(block > EXT4_MAX_BLOCK_FILE_PHYS); | 835 | BUG_ON(block > EXT4_MAX_BLOCK_FILE_PHYS); |
836 | 836 | ||
837 | ea_idebug(inode, "creating block %d", block); | 837 | ea_idebug(inode, "creating block %llu", |
838 | (unsigned long long)block); | ||
838 | 839 | ||
839 | new_bh = sb_getblk(sb, block); | 840 | new_bh = sb_getblk(sb, block); |
840 | if (!new_bh) { | 841 | if (!new_bh) { |