From patchwork Tue Mar 6 23:57:40 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: 145062 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 8BCE9B6F9D for ; Wed, 7 Mar 2012 10:58:13 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932670Ab2CFX56 (ORCPT ); Tue, 6 Mar 2012 18:57:58 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:45321 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932717Ab2CFX5v (ORCPT ); Tue, 6 Mar 2012 18:57:51 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2012 16:57:50 -0700 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2012 16:57:46 -0700 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 906DFC9005E for ; Tue, 6 Mar 2012 18:57:45 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q26Nvjnr227544 for ; Tue, 6 Mar 2012 18:57:45 -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 q26NvirE009526 for ; Tue, 6 Mar 2012 20:57:45 -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 q26NvhfM009502; Tue, 6 Mar 2012 20:57:43 -0300 Subject: [PATCH 03/54] debugfs: Optionally ignore bad checksums 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 15:57:40 -0800 Message-ID: <20120306235740.11945.81087.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: 12030623-4242-0000-0000-000000FA2249 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org If someone is debugging a badly damaged filesystem, it might be useful to disable the checksum verifications that will otherwise prevent the filesystem from loading. Signed-off-by: Darrick J. Wong --- debugfs/debugfs.8.in | 7 ++++++- debugfs/debugfs.c | 7 +++++-- 2 files changed, 11 insertions(+), 3 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/debugfs/debugfs.8.in b/debugfs/debugfs.8.in index 08d9068..157c667 100644 --- a/debugfs/debugfs.8.in +++ b/debugfs/debugfs.8.in @@ -8,7 +8,7 @@ debugfs \- ext2/ext3/ext4 file system debugger .SH SYNOPSIS .B debugfs [ -.B \-DVwci +.B \-DVwcin ] [ .B \-b @@ -48,6 +48,11 @@ file system (e.g /dev/hdXX). Specifies that the file system should be opened in read-write mode. Without this option, the file system is opened in read-only mode. .TP +.I \-n +Disables metadata checksum verification. This should only be used if +you believe the metadata to be correct despite the complaints of +e2fsprogs. +.TP .I \-c Specifies that the file system should be opened in catastrophic mode, in which the inode and group bitmaps are not read initially. This can be diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 04d5139..4ff23ef 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -2271,9 +2271,9 @@ int main(int argc, char **argv) int catastrophic = 0; char *data_filename = 0; #ifdef READ_ONLY - const char *opt_string = "icR:f:b:s:Vd:D"; + const char *opt_string = "nicR:f:b:s:Vd:D"; #else - const char *opt_string = "iwcR:f:b:s:Vd:D"; + const char *opt_string = "niwcR:f:b:s:Vd:D"; #endif if (debug_prog_name == 0) @@ -2300,6 +2300,9 @@ int main(int argc, char **argv) case 'i': open_flags |= EXT2_FLAG_IMAGE_FILE; break; + case 'n': + open_flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; + break; #ifndef READ_ONLY case 'w': open_flags |= EXT2_FLAG_RW;