From patchwork Wed Mar 7 00:02:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 145104 X-Patchwork-Delegate: tytso@mit.edu Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 534D0B6EEC for ; Wed, 7 Mar 2012 11:03:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031611Ab2CGADO (ORCPT ); Tue, 6 Mar 2012 19:03:14 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:42632 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031608Ab2CGADN (ORCPT ); Tue, 6 Mar 2012 19:03:13 -0500 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2012 17:03:11 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2012 17:03:09 -0700 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 063583E4004F for ; Tue, 6 Mar 2012 17:03:07 -0700 (MST) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2702UWC100110 for ; Tue, 6 Mar 2012 17:02:32 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2702Qks019115 for ; Tue, 6 Mar 2012 17:02:27 -0700 Received: from elm3b70.beaverton.ibm.com (elm3b70.beaverton.ibm.com [9.47.67.70]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q2702Ptk019081; Tue, 6 Mar 2012 17:02:25 -0700 Subject: [PATCH 42/54] e2fsck: Verify and correct MMP checksum problems To: Andreas Dilger , Theodore Tso , "Darrick J. Wong" From: "Darrick J. Wong" Cc: Sunil Mushran , Amir Goldstein , Andi Kleen , Mingming Cao , Joel Becker , linux-ext4@vger.kernel.org, Coly Li Date: Tue, 06 Mar 2012 16:02:22 -0800 Message-ID: <20120307000222.11945.34243.stgit@elm3b70.beaverton.ibm.com> In-Reply-To: <20120306235720.11945.30629.stgit@elm3b70.beaverton.ibm.com> References: <20120306235720.11945.30629.stgit@elm3b70.beaverton.ibm.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12030700-3270-0000-0000-000004991B6D Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Check and handle MMP checksum problems by resetting the block. Signed-off-by: Darrick J. Wong --- e2fsck/problem.c | 5 +++++ e2fsck/problem.h | 3 +++ e2fsck/unix.c | 5 +++++ 3 files changed, 13 insertions(+), 0 deletions(-) -- 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 --git a/e2fsck/problem.c b/e2fsck/problem.c index 8c55721..91617bc 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -432,6 +432,11 @@ static struct e2fsck_problem problem_table[] = { "bits cannot be set simultaneously."), PROMPT_FIX, PR_PREEN_OK | PR_NO_OK}, + /* Superblock has invalid MMP checksum. */ + { PR_0_MMP_CSUM_INVALID, + N_("@S MMP block checksum does not match MMP block. "), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK}, + /* Pass 1 errors */ /* Pass 1: Checking inodes, blocks, and sizes */ diff --git a/e2fsck/problem.h b/e2fsck/problem.h index e47984c..f6f1eee 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -248,6 +248,9 @@ struct problem_context { */ #define PR_0_META_AND_GDT_CSUM_SET 0x000044 +/* Superblock has invalid MMP checksum. */ +#define PR_0_MMP_CSUM_INVALID 0x000045 + /* * Pass 1 errors */ diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 678ce9b..d3fb8f8 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1098,6 +1098,11 @@ check_error: ext2fs_mmp_clear(fs); retval = 0; } + } else if (retval == EXT2_ET_MMP_CSUM_INVALID) { + if (fix_problem(ctx, PR_0_MMP_CSUM_INVALID, &pctx)) { + ext2fs_mmp_clear(fs); + retval = 0; + } } return retval; }