diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2009-03-27 16:39:58 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-03-27 16:39:58 -0400 |
commit | 7a262f7c69163cd4811f2f838faef5c5b18439c9 (patch) | |
tree | 1d048ed0fa78d8d768c149cf414bd4325315f184 /fs/ext4/inode.c | |
parent | 56b19868aca856a7d7bf20c3a7a1030e4fd75b2b (diff) |
ext4: Validate extent details only when read from the disk
Make sure we validate extent details only when read from the disk.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Thiemo Nagel <thiemo.nagel@ph.tum.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 25811507d2b..cd0399db0ef 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -4345,6 +4345,16 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) | |||
4345 | (__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32; | 4345 | (__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32; |
4346 | } | 4346 | } |
4347 | 4347 | ||
4348 | if (ei->i_flags & EXT4_EXTENTS_FL) { | ||
4349 | /* Validate extent which is part of inode */ | ||
4350 | ret = ext4_ext_check_inode(inode); | ||
4351 | if (ret) { | ||
4352 | brelse(bh); | ||
4353 | goto bad_inode; | ||
4354 | } | ||
4355 | |||
4356 | } | ||
4357 | |||
4348 | if (S_ISREG(inode->i_mode)) { | 4358 | if (S_ISREG(inode->i_mode)) { |
4349 | inode->i_op = &ext4_file_inode_operations; | 4359 | inode->i_op = &ext4_file_inode_operations; |
4350 | inode->i_fop = &ext4_file_operations; | 4360 | inode->i_fop = &ext4_file_operations; |