diff options
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 2de0e9515089..04338009793a 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -228,9 +228,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name, | |||
228 | atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); | 228 | atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); |
229 | if (ext4_xattr_check_block(bh)) { | 229 | if (ext4_xattr_check_block(bh)) { |
230 | bad_block: | 230 | bad_block: |
231 | ext4_error(inode->i_sb, | 231 | EXT4_ERROR_INODE(inode, "bad block %llu", |
232 | "inode %lu: bad block %llu", inode->i_ino, | 232 | EXT4_I(inode)->i_file_acl); |
233 | EXT4_I(inode)->i_file_acl); | ||
234 | error = -EIO; | 233 | error = -EIO; |
235 | goto cleanup; | 234 | goto cleanup; |
236 | } | 235 | } |
@@ -372,9 +371,8 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size) | |||
372 | ea_bdebug(bh, "b_count=%d, refcount=%d", | 371 | ea_bdebug(bh, "b_count=%d, refcount=%d", |
373 | atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); | 372 | atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); |
374 | if (ext4_xattr_check_block(bh)) { | 373 | if (ext4_xattr_check_block(bh)) { |
375 | ext4_error(inode->i_sb, | 374 | EXT4_ERROR_INODE(inode, "bad block %llu", |
376 | "inode %lu: bad block %llu", inode->i_ino, | 375 | EXT4_I(inode)->i_file_acl); |
377 | EXT4_I(inode)->i_file_acl); | ||
378 | error = -EIO; | 376 | error = -EIO; |
379 | goto cleanup; | 377 | goto cleanup; |
380 | } | 378 | } |
@@ -666,8 +664,8 @@ ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i, | |||
666 | atomic_read(&(bs->bh->b_count)), | 664 | atomic_read(&(bs->bh->b_count)), |
667 | le32_to_cpu(BHDR(bs->bh)->h_refcount)); | 665 | le32_to_cpu(BHDR(bs->bh)->h_refcount)); |
668 | if (ext4_xattr_check_block(bs->bh)) { | 666 | if (ext4_xattr_check_block(bs->bh)) { |
669 | ext4_error(sb, "inode %lu: bad block %llu", | 667 | EXT4_ERROR_INODE(inode, "bad block %llu", |
670 | inode->i_ino, EXT4_I(inode)->i_file_acl); | 668 | EXT4_I(inode)->i_file_acl); |
671 | error = -EIO; | 669 | error = -EIO; |
672 | goto cleanup; | 670 | goto cleanup; |
673 | } | 671 | } |
@@ -820,7 +818,7 @@ inserted: | |||
820 | EXT4_I(inode)->i_block_group); | 818 | EXT4_I(inode)->i_block_group); |
821 | 819 | ||
822 | /* non-extent files can't have physical blocks past 2^32 */ | 820 | /* non-extent files can't have physical blocks past 2^32 */ |
823 | if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) | 821 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |
824 | goal = goal & EXT4_MAX_BLOCK_FILE_PHYS; | 822 | goal = goal & EXT4_MAX_BLOCK_FILE_PHYS; |
825 | 823 | ||
826 | block = ext4_new_meta_blocks(handle, inode, | 824 | block = ext4_new_meta_blocks(handle, inode, |
@@ -828,7 +826,7 @@ inserted: | |||
828 | if (error) | 826 | if (error) |
829 | goto cleanup; | 827 | goto cleanup; |
830 | 828 | ||
831 | if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) | 829 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |
832 | BUG_ON(block > EXT4_MAX_BLOCK_FILE_PHYS); | 830 | BUG_ON(block > EXT4_MAX_BLOCK_FILE_PHYS); |
833 | 831 | ||
834 | ea_idebug(inode, "creating block %d", block); | 832 | ea_idebug(inode, "creating block %d", block); |
@@ -880,8 +878,8 @@ cleanup_dquot: | |||
880 | goto cleanup; | 878 | goto cleanup; |
881 | 879 | ||
882 | bad_block: | 880 | bad_block: |
883 | ext4_error(inode->i_sb, "inode %lu: bad block %llu", | 881 | EXT4_ERROR_INODE(inode, "bad block %llu", |
884 | inode->i_ino, EXT4_I(inode)->i_file_acl); | 882 | EXT4_I(inode)->i_file_acl); |
885 | goto cleanup; | 883 | goto cleanup; |
886 | 884 | ||
887 | #undef header | 885 | #undef header |
@@ -1194,8 +1192,8 @@ retry: | |||
1194 | if (!bh) | 1192 | if (!bh) |
1195 | goto cleanup; | 1193 | goto cleanup; |
1196 | if (ext4_xattr_check_block(bh)) { | 1194 | if (ext4_xattr_check_block(bh)) { |
1197 | ext4_error(inode->i_sb, "inode %lu: bad block %llu", | 1195 | EXT4_ERROR_INODE(inode, "bad block %llu", |
1198 | inode->i_ino, EXT4_I(inode)->i_file_acl); | 1196 | EXT4_I(inode)->i_file_acl); |
1199 | error = -EIO; | 1197 | error = -EIO; |
1200 | goto cleanup; | 1198 | goto cleanup; |
1201 | } | 1199 | } |
@@ -1372,14 +1370,14 @@ ext4_xattr_delete_inode(handle_t *handle, struct inode *inode) | |||
1372 | goto cleanup; | 1370 | goto cleanup; |
1373 | bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); | 1371 | bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); |
1374 | if (!bh) { | 1372 | if (!bh) { |
1375 | ext4_error(inode->i_sb, "inode %lu: block %llu read error", | 1373 | EXT4_ERROR_INODE(inode, "block %llu read error", |
1376 | inode->i_ino, EXT4_I(inode)->i_file_acl); | 1374 | EXT4_I(inode)->i_file_acl); |
1377 | goto cleanup; | 1375 | goto cleanup; |
1378 | } | 1376 | } |
1379 | if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || | 1377 | if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || |
1380 | BHDR(bh)->h_blocks != cpu_to_le32(1)) { | 1378 | BHDR(bh)->h_blocks != cpu_to_le32(1)) { |
1381 | ext4_error(inode->i_sb, "inode %lu: bad block %llu", | 1379 | EXT4_ERROR_INODE(inode, "bad block %llu", |
1382 | inode->i_ino, EXT4_I(inode)->i_file_acl); | 1380 | EXT4_I(inode)->i_file_acl); |
1383 | goto cleanup; | 1381 | goto cleanup; |
1384 | } | 1382 | } |
1385 | ext4_xattr_release_block(handle, inode, bh); | 1383 | ext4_xattr_release_block(handle, inode, bh); |
@@ -1504,9 +1502,8 @@ again: | |||
1504 | } | 1502 | } |
1505 | bh = sb_bread(inode->i_sb, ce->e_block); | 1503 | bh = sb_bread(inode->i_sb, ce->e_block); |
1506 | if (!bh) { | 1504 | if (!bh) { |
1507 | ext4_error(inode->i_sb, | 1505 | EXT4_ERROR_INODE(inode, "block %lu read error", |
1508 | "inode %lu: block %lu read error", | 1506 | (unsigned long) ce->e_block); |
1509 | inode->i_ino, (unsigned long) ce->e_block); | ||
1510 | } else if (le32_to_cpu(BHDR(bh)->h_refcount) >= | 1507 | } else if (le32_to_cpu(BHDR(bh)->h_refcount) >= |
1511 | EXT4_XATTR_REFCOUNT_MAX) { | 1508 | EXT4_XATTR_REFCOUNT_MAX) { |
1512 | ea_idebug(inode, "block %lu refcount %d>=%d", | 1509 | ea_idebug(inode, "block %lu refcount %d>=%d", |