]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ext4: remove unmeetable inconsisteny check from ext4_find_extent()
authorNicolai Stange <nicstange@gmail.com>
Fri, 6 May 2016 02:43:04 +0000 (22:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 6 May 2016 02:43:04 +0000 (22:43 -0400)
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>
fs/ext4/extents.c

index c53d5a8d2a79100c17bd70ebb677be94d1869efb..2a2eef9c14e4b66212597b651bd87aa9f3ed6b7c 100644 (file)
@@ -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;
        }