e2fsck: zero errcode when checking inline data blocks

When checking inline data blocks, always zero pctx->errcode because
otherwise a previous error condition could leak through and "cause" a
fatal block iteration failure.  I found this by corrupting an xattr
block on an inline_data inode and fsck aborted when I tried to repair
it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
crypto
Darrick J. Wong 2014-03-14 09:26:21 -04:00 committed by Theodore Ts'o
parent 97bd89cd39
commit cc7d12ac37
1 changed files with 3 additions and 1 deletions

View File

@ -2158,8 +2158,10 @@ static void check_blocks_extents(e2fsck_t ctx, struct problem_context *pctx,
static void check_blocks_inline_data(e2fsck_t ctx, struct problem_context *pctx,
struct process_block_struct *pb)
{
if (!pb->is_dir)
if (!pb->is_dir) {
pctx->errcode = 0;
return;
}
pctx->errcode = ext2fs_add_dir_block2(ctx->fs->dblist, pb->ino, 0, 0);
if (pctx->errcode) {