diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 13:26:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 13:26:37 -0400 |
commit | e4ce30f3779c2ddaa7dfaa4042209e5dbacbada5 (patch) | |
tree | cc64c1dcd16b5dbf71ebc8338b339e6fb04abaee /fs/ext4/xattr.c | |
parent | b899ebeb05da4287ce845976727e3e83dadd25d5 (diff) | |
parent | 14ece1028b3ed53ffec1b1213ffc6acaf79ad77c (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (40 commits)
ext4: Make fsync sync new parent directories in no-journal mode
ext4: Drop whitespace at end of lines
ext4: Fix compat EXT4_IOC_ADD_GROUP
ext4: Conditionally define compat ioctl numbers
tracing: Convert more ext4 events to DEFINE_EVENT
ext4: Add new tracepoints to track mballoc's buddy bitmap loads
ext4: Add a missing trace hook
ext4: restart ext4_ext_remove_space() after transaction restart
ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted
ext4: Avoid crashing on NULL ptr dereference on a filesystem error
ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
ext4: Convert calls of ext4_error() to EXT4_ERROR_INODE()
ext4: Convert callers of ext4_get_blocks() to use ext4_map_blocks()
ext4: Add new abstraction ext4_map_blocks() underneath ext4_get_blocks()
ext4: Use our own write_cache_pages()
ext4: Show journal_checksum option
ext4: Fix for ext4_mb_collect_stats()
ext4: check for a good block group before loading buddy pages
ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate
ext4: Remove extraneous newlines in ext4_msg() calls
...
Fixed up trivial conflict in fs/ext4/fsync.c
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", |