From patchwork Wed Mar 7 00:02:07 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: 145106 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 3AFC6B6EEC for ; Wed, 7 Mar 2012 11:03:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031612Ab2CGADR (ORCPT ); Tue, 6 Mar 2012 19:03:17 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:36341 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031610Ab2CGADR (ORCPT ); Tue, 6 Mar 2012 19:03:17 -0500 Received: from /spool/local by e4.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2012 19:03:16 -0500 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e4.ny.us.ibm.com (192.168.1.104) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2012 19:02:17 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id F016F6E8049 for ; Tue, 6 Mar 2012 19:02:16 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2702GRd339330 for ; Tue, 6 Mar 2012 19:02:16 -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 q2702Dv2006706 for ; Tue, 6 Mar 2012 19:02:15 -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 q2702ATG006454; Tue, 6 Mar 2012 19:02:10 -0500 Subject: [PATCH 40/54] mke2fs: Warn if not enabling all the features that metadata_csum wants 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:07 -0800 Message-ID: <20120307000207.11945.9180.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-3534-0000-0000-0000065BFB1C Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The metadata_csum feature works best when two features are enabled. These features are "extents" (because the block map has no space for checksums) and "64bit" (this enables storage of full 32-bit checksums in certain fields). Print a warning if the user tries to create a filesystem without those features. Signed-off-by: Darrick J. Wong --- misc/mke2fs.c | 19 +++++++++++++++++++ 1 files changed, 19 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/mke2fs.c b/misc/mke2fs.c index 61b332a..e8c60ca 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -2309,6 +2309,25 @@ int main (int argc, char *argv[]) exit(1); } + /* Check the user's mkfs options for metadata checksumming */ + if (!quiet && + EXT2_HAS_RO_COMPAT_FEATURE(fs->super, + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) { + if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT3_FEATURE_INCOMPAT_EXTENTS)) + printf(_("Extents are not enabled. The file extent " + "tree can be checksummed, whereas block maps " + "cannot. Not enabling extents reduces the " + "coverage of metadata checksumming. " + "Pass -O extents to rectify.\n")); + if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT4_FEATURE_INCOMPAT_64BIT)) + printf(_("64-bit filesystem support is not " + "enabled. The larger fields afforded by " + "this feature enable full-strength " + "checksumming. Pass -O 64bit to rectify.\n")); + } + /* Can't undo discard ... */ if (!noaction && discard && (io_ptr != undo_io_manager)) { retval = mke2fs_discard_device(fs);