From: Eric Sandeen Date: Wed, 2 Apr 2008 01:38:58 +0000 (-0500) Subject: e2fsck: Only check PR_1_EXTENT_ENDS_BEYOND for leaf nodes X-Git-Tag: v1.41-WIP-0427~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a1eac2fbe8bcd6588a198af51f66347bb10f5ab;p=thirdparty%2Fe2fsprogs.git e2fsck: Only check PR_1_EXTENT_ENDS_BEYOND for leaf nodes 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 Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index ee9186f27..c729ea3b0 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -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;