Whamcloud - gitweb
e2fsck: Only check PR_1_EXTENT_ENDS_BEYOND for leaf nodes
authorEric Sandeen <sandeen@redhat.com>
Wed, 2 Apr 2008 01:38:58 +0000 (20:38 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 17 Apr 2008 21:16:47 +0000 (17:16 -0400)
pass1 was checking that an "extent's" start+len did not extend
past the last filesystem block, but unless we are at a leaf
block, the physical block is that of a node in the tree, and
the length may include sparseness.  The test is only valid
for leaf blocks.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index ee9186f..c729ea3 100644 (file)
@@ -1634,7 +1634,8 @@ static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx,
                if (extent.e_pblk < ctx->fs->super->s_first_data_block ||
                    extent.e_pblk >= ctx->fs->super->s_blocks_count)
                        problem = PR_1_EXTENT_BAD_START_BLK;
-               else if ((extent.e_pblk + extent.e_len) >
+               else if (is_leaf &&
+                        (extent.e_pblk + extent.e_len) >
                         ctx->fs->super->s_blocks_count)
                        problem = PR_1_EXTENT_ENDS_BEYOND;