From patchwork Thu Oct 26 22:14:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10028803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A13860381 for ; Thu, 26 Oct 2017 22:15:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 490E028E68 for ; Thu, 26 Oct 2017 22:15:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AFFC28E74; Thu, 26 Oct 2017 22:15:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3F8928E68 for ; Thu, 26 Oct 2017 22:15:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751228AbdJZWPH (ORCPT ); Thu, 26 Oct 2017 18:15:07 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:50895 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbdJZWPG (ORCPT ); Thu, 26 Oct 2017 18:15:06 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v9QMF3rK014809 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Oct 2017 22:15:03 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v9QMF3sQ031145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Oct 2017 22:15:03 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v9QMF2XD016243; Thu, 26 Oct 2017 22:15:02 GMT Received: from localhost (/10.145.178.58) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Oct 2017 15:15:02 -0700 Subject: [PATCH 01/10] db: increase metadump's default overly long extent discard threshold From: "Darrick J. Wong" To: sandeen@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, Carlos Maiolino Date: Thu, 26 Oct 2017 15:14:59 -0700 Message-ID: <150905609902.28563.7772086766206671184.stgit@magnolia> In-Reply-To: <150905608689.28563.9670731739870415773.stgit@magnolia> References: <150905608689.28563.9670731739870415773.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Back in 88b8e1d6d7 ("Make xfs_metadump more robust against bad data"), metadump grew the ability to ignore a directory extent if it was longer than 20 blocks. Presumably this was to protect metadump from dumping absurdly long extents resulting from bmbt corruption, but it's certainly possible to create a directory with an extent longer than 20 blocks. Hilariously, the discards happen with no warning unless the caller explicitly set -w. This was raised to 1000 blocks in 7431d134fe8 ("Increase default maximum extent size for xfs_metadump when copying..."), but it's still possible to create a directory with an extent longer than 1000 blocks. Increase the threshold to MAXEXTLEN blocks because it's totally valid for the filesystem to create extents up to that length. Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino --- db/metadump.c | 2 +- man/man8/xfs_metadump.8 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" 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/db/metadump.c b/db/metadump.c index 6dd06c3..8ffb90f 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -32,7 +32,7 @@ #include "field.h" #include "dir2.h" -#define DEFAULT_MAX_EXT_SIZE 1000 +#define DEFAULT_MAX_EXT_SIZE MAXEXTLEN /* * It's possible that multiple files in a directory (or attributes diff --git a/man/man8/xfs_metadump.8 b/man/man8/xfs_metadump.8 index 3731d6a..7207c20 100644 --- a/man/man8/xfs_metadump.8 +++ b/man/man8/xfs_metadump.8 @@ -114,7 +114,7 @@ copied. .B \-m Set the maximum size of an allowed metadata extent. Extremely large metadata extents are likely to be corrupt, and will be skipped if they exceed -this value. The default size is 1000 blocks. +this value. The default size is 2097151 blocks. .TP .B \-o Disables obfuscation of file names and extended attributes.