diff options
author | Eryu Guan <guaneryu@gmail.com> | 2015-05-14 19:00:45 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-05-14 19:00:45 -0400 |
commit | 2f974865ffdfe7b9f46a9940836c8b167342563d (patch) | |
tree | fa8e553e8343141ff00a84c9589b54783cb1dbb6 /fs/ext4/extents.c | |
parent | 9d506594069355d1fb2de3f9104667312ff08ed3 (diff) | |
download | op-kernel-dev-2f974865ffdfe7b9f46a9940836c8b167342563d.zip op-kernel-dev-2f974865ffdfe7b9f46a9940836c8b167342563d.tar.gz |
ext4: check for zero length extent explicitly
The following commit introduced a bug when checking for zero length extent
5946d08 ext4: check for overlapping extents in ext4_valid_extent_entries()
Zero length extent could pass the check if lblock is zero.
Adding the explicit check for zero length back.
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index d74e0802..451b92a 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -377,7 +377,7 @@ static int ext4_valid_extent(struct inode *inode, struct ext4_extent *ext) ext4_lblk_t lblock = le32_to_cpu(ext->ee_block); ext4_lblk_t last = lblock + len - 1; - if (lblock > last) + if (len == 0 || lblock > last) return 0; return ext4_data_block_valid(EXT4_SB(inode->i_sb), block, len); } |