From patchwork Wed Mar 7 00:02:42 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: 145100 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 BFCFFB6EEC for ; Wed, 7 Mar 2012 11:02:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965284Ab2CGACx (ORCPT ); Tue, 6 Mar 2012 19:02:53 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:55415 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965279Ab2CGACw (ORCPT ); Tue, 6 Mar 2012 19:02:52 -0500 Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2012 17:02:52 -0700 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2012 17:02:48 -0700 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 9F55AC90058 for ; Tue, 6 Mar 2012 19:02:47 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2702lBG2723940 for ; Tue, 6 Mar 2012 19:02:47 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2702kfD009458 for ; Tue, 6 Mar 2012 19:02:47 -0500 Received: from elm3b70.beaverton.ibm.com (elm3b70.beaverton.ibm.com [9.47.67.70]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q2702i0s009354; Tue, 6 Mar 2012 19:02:45 -0500 Subject: [PATCH 45/54] libext2fs: Dump feature flags for jbd2 v2 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 16:02:42 -0800 Message-ID: <20120307000242.11945.79105.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-7408-0000-0000-0000034207C4 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Modify the dump code to print information about jbd2 v2 checksum data. Signed-off-by: Darrick J. Wong --- lib/e2p/feature.c | 2 ++ misc/dumpe2fs.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 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/lib/e2p/feature.c b/lib/e2p/feature.c index 19e6f0c..486f846 100644 --- a/lib/e2p/feature.c +++ b/lib/e2p/feature.c @@ -98,6 +98,8 @@ static struct feature jrnl_feature_list[] = { "journal_incompat_revoke" }, { E2P_FEATURE_INCOMPAT, JFS_FEATURE_INCOMPAT_ASYNC_COMMIT, "journal_async_commit" }, + { E2P_FEATURE_INCOMPAT, JFS_FEATURE_INCOMPAT_CSUM_V2, + "journal_checksum_v2" }, { 0, 0, 0 }, }; diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 40398a7..3ceb0f8 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -311,6 +311,16 @@ static void list_bad_blocks(ext2_filsys fs, int dump) ext2fs_badblocks_list_free(bb_list); } +static char *journal_checksum_type_str(__u8 type) +{ + switch (type) { + case JBD2_CRC32C_CHKSUM: + return "crc32c"; + default: + return "unknown"; + } +} + static void print_inline_journal_information(ext2_filsys fs) { journal_superblock_t *jsb; @@ -377,6 +387,15 @@ static void print_inline_journal_information(ext2_filsys fs) (unsigned int)ntohl(jsb->s_maxlen), (unsigned int)ntohl(jsb->s_sequence), (unsigned int)ntohl(jsb->s_start)); + if (jsb->s_feature_compat & + ext2fs_cpu_to_be32(JFS_FEATURE_COMPAT_CHECKSUM)) + printf(_("Journal checksum type: crc32\n")); + if (jsb->s_feature_incompat & + ext2fs_cpu_to_be32(JFS_FEATURE_INCOMPAT_CSUM_V2)) + printf(_("Journal checksum type: %s\n" + "Journal checksum: 0x%08x\n"), + journal_checksum_type_str(jsb->s_checksum_type), + ext2fs_be32_to_cpu(jsb->s_checksum)); } static void print_journal_information(ext2_filsys fs) @@ -402,6 +421,16 @@ static void print_journal_information(ext2_filsys fs) exit(1); } + if (jsb->s_feature_compat & + ext2fs_cpu_to_be32(JFS_FEATURE_COMPAT_CHECKSUM)) + printf(_("Journal checksum type: crc32\n")); + if (jsb->s_feature_incompat & + ext2fs_cpu_to_be32(JFS_FEATURE_INCOMPAT_CSUM_V2)) + printf(_("Journal checksum type: %s\n" + "Journal checksum: 0x%08x\n"), + journal_checksum_type_str(jsb->s_checksum_type), + ext2fs_be32_to_cpu(jsb->s_checksum)); + printf(_("\nJournal block size: %u\n" "Journal length: %u\n" "Journal first block: %u\n"