From patchwork Sat Jan 7 08:36:34 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: 134821 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 DEC7BB6F7E for ; Sat, 7 Jan 2012 19:36:42 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754675Ab2AGIgl (ORCPT ); Sat, 7 Jan 2012 03:36:41 -0500 Received: from e5.ny.us.ibm.com ([32.97.182.145]:52402 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758732Ab2AGIgk (ORCPT ); Sat, 7 Jan 2012 03:36:40 -0500 Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 7 Jan 2012 03:36:39 -0500 Received: from d01relay02.pok.ibm.com (9.56.227.234) by e5.ny.us.ibm.com (192.168.1.105) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 7 Jan 2012 03:36:38 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q078abId427206 for ; Sat, 7 Jan 2012 03:36:37 -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 q078aZxE032032 for ; Sat, 7 Jan 2012 03:36:37 -0500 Received: from elm3c44.beaverton.ibm.com (elm3c44.beaverton.ibm.com [9.47.69.44]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q078aYKt032002; Sat, 7 Jan 2012 03:36:34 -0500 Subject: [PATCH 34/51] tune2fs: Store checksum algorithm type in superblock 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: Sat, 07 Jan 2012 00:36:34 -0800 Message-ID: <20120107083634.25788.38633.stgit@elm3c44.beaverton.ibm.com> In-Reply-To: <20120107083256.25788.41238.stgit@elm3c44.beaverton.ibm.com> References: <20120107083256.25788.41238.stgit@elm3c44.beaverton.ibm.com> User-Agent: StGit/0.15 MIME-Version: 1.0 x-cbid: 12010708-5930-0000-0000-000003DF9184 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Actually records the checksum algorithm type in the superblock when enabling checksumming. Signed-off-by: Darrick J. Wong --- misc/tune2fs.c | 6 ++++++ 1 files changed, 6 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/misc/tune2fs.c b/misc/tune2fs.c index 2ae436e..ac5e945 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -701,6 +701,12 @@ static void rewrite_metadata_checksums(ext2_filsys fs) ext2fs_mark_bb_dirty(fs); fs->flags &= ~EXT2_FLAG_SUPER_ONLY; fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; + if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) + fs->super->s_checksum_type = EXT2_CRC32C_CHKSUM; + else + fs->super->s_checksum_type = 0; + ext2fs_mark_super_dirty(fs); } /*