aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-27 11:39:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-27 11:39:02 -0400
commite25c2c873f59c57cf1c2b1979cc8fb01958305ef (patch)
treeb59caf26d45143da04f51e2a4bdd91f64de7baa4
parent51b3960e78575f96c989d08421596bb6ab569f44 (diff)
parentc4b5a614316c505922a522b2e35ba05ea3e08a7c (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: ext4: Do not try to validate extents on special files ext4: Ignore i_file_acl_high unless EXT4_FEATURE_INCOMPAT_64BIT is present ext4: Fix softlockup caused by illegal i_file_acl value in on-disk inode
-rw-r--r--fs/ext4/inode.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c6bd6ced3bb7..e91f978c7f12 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4357,11 +4357,9 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4357 ei->i_flags = le32_to_cpu(raw_inode->i_flags); 4357 ei->i_flags = le32_to_cpu(raw_inode->i_flags);
4358 inode->i_blocks = ext4_inode_blocks(raw_inode, ei); 4358 inode->i_blocks = ext4_inode_blocks(raw_inode, ei);
4359 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl_lo); 4359 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl_lo);
4360 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != 4360 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT))
4361 cpu_to_le32(EXT4_OS_HURD)) {
4362 ei->i_file_acl |= 4361 ei->i_file_acl |=
4363 ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32; 4362 ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32;
4364 }
4365 inode->i_size = ext4_isize(raw_inode); 4363 inode->i_size = ext4_isize(raw_inode);
4366 ei->i_disksize = inode->i_size; 4364 ei->i_disksize = inode->i_size;
4367 inode->i_generation = le32_to_cpu(raw_inode->i_generation); 4365 inode->i_generation = le32_to_cpu(raw_inode->i_generation);
@@ -4409,9 +4407,23 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4409 (__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32; 4407 (__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32;
4410 } 4408 }
4411 4409
4412 if (ei->i_flags & EXT4_EXTENTS_FL) { 4410 ret = 0;
4413 /* Validate extent which is part of inode */ 4411 if (ei->i_file_acl &&
4414 ret = ext4_ext_check_inode(inode); 4412 ((ei->i_file_acl <
4413 (le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block) +
4414 EXT4_SB(sb)->s_gdb_count)) ||
4415 (ei->i_file_acl >= ext4_blocks_count(EXT4_SB(sb)->s_es)))) {
4416 ext4_error(sb, __func__,
4417 "bad extended attribute block %llu in inode #%lu",
4418 ei->i_file_acl, inode->i_ino);
4419 ret = -EIO;
4420 goto bad_inode;
4421 } else if (ei->i_flags & EXT4_EXTENTS_FL) {
4422 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
4423 (S_ISLNK(inode->i_mode) &&
4424 !ext4_inode_is_fast_symlink(inode)))
4425 /* Validate extent which is part of inode */
4426 ret = ext4_ext_check_inode(inode);
4415 } else if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 4427 } else if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
4416 (S_ISLNK(inode->i_mode) && 4428 (S_ISLNK(inode->i_mode) &&
4417 !ext4_inode_is_fast_symlink(inode))) { 4429 !ext4_inode_is_fast_symlink(inode))) {