From patchwork Wed Mar 7 00:00:57 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: 145091 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 34B1EB6F98 for ; Wed, 7 Mar 2012 11:01:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031594Ab2CGABf (ORCPT ); Tue, 6 Mar 2012 19:01:35 -0500 Received: from e34.co.us.ibm.com ([32.97.110.152]:57524 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031282Ab2CGABe (ORCPT ); Tue, 6 Mar 2012 19:01:34 -0500 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2012 17:01:32 -0700 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2012 17:01:06 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id E4C40C90050 for ; Tue, 6 Mar 2012 19:01:04 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q27015Q2327770 for ; Tue, 6 Mar 2012 19:01:05 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q27011Tq024369 for ; Tue, 6 Mar 2012 21:01:04 -0300 Received: from elm3b70.beaverton.ibm.com (elm3b70.beaverton.ibm.com [9.47.67.70]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q2700xYF024156; Tue, 6 Mar 2012 21:01:00 -0300 Subject: [PATCH 32/54] e2fsck: Handle superblock checksum errors gracefully 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:00:57 -0800 Message-ID: <20120307000057.11945.48853.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-1780-0000-0000-000003C2F350 X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000255; HX=3.00000184; KW=3.00000007; PH=3.00000001; SC=3.00000001; SDB=6.00119783; UDB=6.00028999; UTC=2012-03-07 00:01:28 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If e2fsck finds a superblock with an invalid checksum, try the backups. Signed-off-by: Darrick J. Wong --- e2fsck/unix.c | 1 + 1 files changed, 1 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/unix.c b/e2fsck/unix.c index 6f97b0f..a8e3775 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1198,6 +1198,7 @@ restart: if (!ctx->superblock && !(ctx->options & E2F_OPT_PREEN) && !(ctx->flags & E2F_FLAG_SB_SPECIFIED) && ((retval == EXT2_ET_BAD_MAGIC) || + (retval == EXT2_ET_SB_CSUM_INVALID) || (retval == EXT2_ET_CORRUPT_SUPERBLOCK) || ((retval == 0) && (retval2 = ext2fs_check_desc(fs))))) { if (retval2 == ENOMEM) {