From: "Darrick J. Wong" Subject: [PATCH 32/51] e2fsck: Handle superblock checksum errors gracefully Date: Sat, 07 Jan 2012 00:36:21 -0800 Message-ID: <20120107083621.25788.65784.stgit@elm3c44.beaverton.ibm.com> References: <20120107083256.25788.41238.stgit@elm3c44.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Sunil Mushran , Amir Goldstein , Andi Kleen , Mingming Cao , Joel Becker , linux-ext4@vger.kernel.org, Coly Li To: Andreas Dilger , Theodore Tso , "Darrick J. Wong" Return-path: Received: from e7.ny.us.ibm.com ([32.97.182.137]:58818 "EHLO e7.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755369Ab2AGIgq (ORCPT ); Sat, 7 Jan 2012 03:36:46 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 7 Jan 2012 03:36:45 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q078aN1g281560 for ; Sat, 7 Jan 2012 03:36:23 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q078aMnP012356 for ; Sat, 7 Jan 2012 06:36:23 -0200 In-Reply-To: <20120107083256.25788.41238.stgit@elm3c44.beaverton.ibm.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: 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(-) diff --git a/e2fsck/unix.c b/e2fsck/unix.c index d2a8c80..0881002 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1186,6 +1186,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) {