add patch refactor-direct-IO-code
[ext4-patch-queue.git] / remove-unmeetable-inconsistency-check
blob7c281cc8fc93e42b8a78d6c285d6baf4de1a3c6a
1 ext4: remove unmeetable inconsisteny check from ext4_find_extent()
3 From: Nicolai Stange <nicstange@gmail.com>
5 ext4_find_extent(), stripped down to the parts relevant to this patch,
6 reads as
8   ppos = 0;
9   i = depth;
10   while (i) {
11     --i;
12     ++ppos;
13     if (unlikely(ppos > depth)) {
14       ...
15       ret = -EFSCORRUPTED;
16       goto err;
17     }
18   }
20 Due to the loop's bounds, the condition ppos > depth can never be met.
22 Remove this dead code.
24 Signed-off-by: Nicolai Stange <nicstange@gmail.com>
25 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
26 ---
27  Applicable to linux-next-20150415.
29  fs/ext4/extents.c | 7 -------
30  1 file changed, 7 deletions(-)
32 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
33 index 95bf467..d01a405 100644
34 --- a/fs/ext4/extents.c
35 +++ b/fs/ext4/extents.c
36 @@ -907,13 +907,6 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,
38                 eh = ext_block_hdr(bh);
39                 ppos++;
40 -               if (unlikely(ppos > depth)) {
41 -                       put_bh(bh);
42 -                       EXT4_ERROR_INODE(inode,
43 -                                        "ppos %d > depth %d", ppos, depth);
44 -                       ret = -EFSCORRUPTED;
45 -                       goto err;
46 -               }
47                 path[ppos].p_bh = bh;
48                 path[ppos].p_hdr = eh;
49         }
50 -- 
51 2.8.1
54 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
55 the body of a message to majordomo@vger.kernel.org
56 More majordomo info at  http://vger.kernel.org/majordomo-info.html