diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-01-09 12:01:31 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-01-09 12:01:31 +0800 |
commit | eaa88578f2135fa8548d5f127259904a1b3f44c0 (patch) | |
tree | 18891deaea2a586e0ee370af189f0f2613b654a9 /fs/ext4/inode.c | |
parent | 6381499f5898ef4144b1522cf35caab69d4d95eb (diff) | |
parent | a3edc7b2e537e36bb26c94fa9efcc249ef3a5862 (diff) |
Merge tag 'v4.4.40' into linux-linaro-lsk-v4.4
This is the 4.4.40 stable release
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index c71d2941a45b..10690e5ba2eb 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4175,6 +4175,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) struct inode *inode; journal_t *journal = EXT4_SB(sb)->s_journal; long ret; + loff_t size; int block; uid_t i_uid; gid_t i_gid; @@ -4266,6 +4267,11 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) ei->i_file_acl |= ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32; inode->i_size = ext4_isize(raw_inode); + if ((size = i_size_read(inode)) < 0) { + EXT4_ERROR_INODE(inode, "bad i_size value: %lld", size); + ret = -EFSCORRUPTED; + goto bad_inode; + } ei->i_disksize = inode->i_size; #ifdef CONFIG_QUOTA ei->i_reserved_quota = 0; |