diff mbox

[11/49] e2fsck: zero errcode when checking inline data blocks

Message ID 20140311065508.30585.30041.stgit@birch.djwong.org
State Accepted, archived
Headers show

Commit Message

Darrick Wong March 11, 2014, 6:55 a.m. UTC
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>
---
 e2fsck/pass1.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Theodore Ts'o March 14, 2014, 1:26 p.m. UTC | #1
On Mon, Mar 10, 2014 at 11:55:08PM -0700, Darrick J. Wong wrote:
> 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>

Thanks, applied.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 11b3dde..641b3fb 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -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) {