mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/ext4: ext4_find_extent(): remove unmeetable inconsisteny check
@ 2016-04-16  8:31 Nicolai Stange
  0 siblings, 0 replies; only message in thread
From: Nicolai Stange @ 2016-04-16  8:31 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger
  Cc: linux-ext4, linux-kernel, Nicolai Stange

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>
---
 Applicable to linux-next-20150415.

 fs/ext4/extents.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 95bf467..d01a405 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -907,13 +907,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;
 	}
-- 
2.8.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-16  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-16  8:31 [PATCH] fs/ext4: ext4_find_extent(): remove unmeetable inconsisteny check Nicolai Stange

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®