From: Theodore Ts'o Date: Sun, 20 Mar 2005 21:57:10 +0000 (-0500) Subject: Fix bug in e2fsck where we don't notice if a file with an extended X-Git-Tag: E2FSPROGS-1_37~12 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=dc71f23e634724f6571a556e6c6ec26d0e882211;p=tools%2Fe2fsprogs.git Fix bug in e2fsck where we don't notice if a file with an extended attribute block is so big that i_blocks wraps to zero. --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index ecc3159..096f79e 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2005-03-20 Theodore Ts'o + + * pass1.c (check_blocks): Move counting the extended attribute + block earlier so that we don't have to worry about + num_blocks wrapping for files which are too big. + 2006-02-05 Theodore Ts'o * Release of E2fsprogs 1.36 diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 1e76ef9..ea61aa5 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -1260,6 +1260,9 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx, } } + if (inode->i_file_acl && check_ext_attr(ctx, pctx, block_buf)) + pb.num_blocks++; + if (ext2fs_inode_has_valid_blocks(inode)) pctx->errcode = ext2fs_block_iterate2(fs, ino, pb.is_dir ? BLOCK_FLAG_HOLE : 0, @@ -1320,9 +1323,6 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx, } } - if (inode->i_file_acl && check_ext_attr(ctx, pctx, block_buf)) - pb.num_blocks++; - pb.num_blocks *= (fs->blocksize / 512); #if 0 printf("inode %u, i_size = %lu, last_block = %lld, i_blocks=%lu, num_blocks = %lu\n",