Skip to content

Commit e44543b

Browse files
Thiemo Nageltytso
authored andcommitted
ext4: Fix off-by-one-error in ext4_valid_extent_idx()
Signed-off-by: Thiemo Nagel <thiemo.nagel@ph.tum.de> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent f73953c commit e44543b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/extents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static int ext4_valid_extent_idx(struct inode *inode,
342342
ext4_fsblk_t block = idx_pblock(ext_idx);
343343
struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
344344
if (unlikely(block < le32_to_cpu(es->s_first_data_block) ||
345-
(block > ext4_blocks_count(es))))
345+
(block >= ext4_blocks_count(es))))
346346
return 0;
347347
else
348348
return 1;

0 commit comments

Comments
 (0)