Skip to content

Commit

Permalink
ext4: remove unmeetable inconsisteny check from ext4_find_extent()
Browse files Browse the repository at this point in the history
ext4_find_extent(), stripped down to the parts relevant to this patch,
reads as

  ppos = 0;
  i = depth;
  while (i) {
    --i;
    ++ppos;
    if (unlikely(ppos > depth)) {
      ...
      ret = -EFSCORRUPTED;
      goto err;
    }
  }

Due to the loop's bounds, the condition ppos > depth can never be met.

Remove this dead code.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
nicstange authored and tytso committed May 6, 2016
1 parent 466c3fb commit 816cd71
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,13 +912,6 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,

eh = ext_block_hdr(bh);
ppos++;
if (unlikely(ppos > depth)) {
put_bh(bh);
EXT4_ERROR_INODE(inode,
"ppos %d > depth %d", ppos, depth);
ret = -EFSCORRUPTED;
goto err;
}
path[ppos].p_bh = bh;
path[ppos].p_hdr = eh;
}
Expand Down

0 comments on commit 816cd71

Please sign in to comment.