From patchwork Sun Jan 26 11:35:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11351819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 669C01398 for ; Sun, 26 Jan 2020 11:36:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BAD820700 for ; Sun, 26 Jan 2020 11:36:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="T7FLOldF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387394AbgAZLgE (ORCPT ); Sun, 26 Jan 2020 06:36:04 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47256 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbgAZLgE (ORCPT ); Sun, 26 Jan 2020 06:36:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I+WRzRbkEmVcsGD0rCc/ZFXJqXvy5BASpe4e86R9DBQ=; b=T7FLOldFVUQ//d8kO8r6fTMqn kKkdhSthfYXn83YOanemRX2BOnQAWoIgl6udwlSy82XJRvKMYcj5febYNk0hW5F2Tb9bT+AIzlQrO qmKfj2Rzl1M3YX6xvf1v4qabl0y7dfox6RqgcAoYhDnjP81f23uj+ErOX38tcTHNP1fOjswIhhg21 CDgMfe6LB4MUGabIcl/oBzl03cncB5FNVrlTptEaUxLUQeGkeJDV4b04vA0whKhv4JKbDFzKyeVKN 0e2njtjBpqqoC9puY6xZK9QS7/oWbayYB2RBtdpjfXXCvrofC3xh7XxwIdyluWkB7UR8aoo7YnyBO O+bPOCzmw==; Received: from [46.189.28.128] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ivgCw-0008A3-Hl for linux-xfs@vger.kernel.org; Sun, 26 Jan 2020 11:36:04 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 1/5] xfsprogs: remove the ENABLE_GETTEXT substitution in platform_defs.h.in Date: Sun, 26 Jan 2020 12:35:37 +0100 Message-Id: <20200126113541.787884-2-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200126113541.787884-1-hch@lst.de> References: <20200126113541.787884-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org ENABLE_GETTEXT is already defined on the command line if enabled, no need to duplicate it in platform_defs.h.in. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- include/platform_defs.h.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 1f7ceafb..6cc56e31 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -36,8 +36,6 @@ typedef struct filldir filldir_t; typedef unsigned short umode_t; #endif -/* Define if you want gettext (I18N) support */ -#undef ENABLE_GETTEXT #ifdef ENABLE_GETTEXT # include # define _(x) gettext(x) From patchwork Sun Jan 26 11:35:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11351821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C42FA92A for ; Sun, 26 Jan 2020 11:36:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 980C320700 for ; Sun, 26 Jan 2020 11:36:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pfUSDFdE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729255AbgAZLgP (ORCPT ); Sun, 26 Jan 2020 06:36:15 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47262 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbgAZLgP (ORCPT ); Sun, 26 Jan 2020 06:36:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jwcm3EybhJoixusZ+7B7Ht2NyrKET5NCZJKhVTHy2yE=; b=pfUSDFdE+Itc/U+M7e8G7H9rI 4MaLI5iJYkgXugoNBkImHLrwcKFytuedf3AJJx35Fear5x08Bg1nxMk2LQlyqpyh/Xk2gq+FFLpQs hhigDlmFinr0ZOmNDNOfPmp943Nc/ClHglqo71SSNxx0ugaKpaDPLiio3mrQ0eiUCuj4lvL2gkHRt FRPMbpm3PiwSBgHyFSPffGcjAYXulOxChVJ/YOakT/ltL/9gXnUyZ+k4YO7+Y8K0uMUDNR5ib2XSF ep8HmD0Ml7bWCjPv/xiIxTvNNYr9QRjfNADcXTz4PhRm6N31TEH1+QcRtaAp+rX4wWdra+nrR1ljL T0S7+FG4Q==; Received: from [46.189.28.128] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ivgD7-0008AV-8L for linux-xfs@vger.kernel.org; Sun, 26 Jan 2020 11:36:14 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 2/5] xfsprogs: remove the SIZEOF_CHAR_P substitution in platform_defs.h.in Date: Sun, 26 Jan 2020 12:35:38 +0100 Message-Id: <20200126113541.787884-3-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200126113541.787884-1-hch@lst.de> References: <20200126113541.787884-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org SIZEOF_CHAR_P is not used anywhere in the code, so remove the reference to it. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- include/platform_defs.h.in | 1 - 1 file changed, 1 deletion(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 6cc56e31..ff0a6a4e 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -28,7 +28,6 @@ typedef struct filldir filldir_t; /* long and pointer must be either 32 bit or 64 bit */ #undef SIZEOF_LONG -#undef SIZEOF_CHAR_P #define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT) /* Check whether to define umode_t ourselves. */ From patchwork Sun Jan 26 11:35:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11351823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 936F21398 for ; Sun, 26 Jan 2020 11:36:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 719C0206D5 for ; Sun, 26 Jan 2020 11:36:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="h22qdLw5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387417AbgAZLgZ (ORCPT ); Sun, 26 Jan 2020 06:36:25 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47272 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387416AbgAZLgZ (ORCPT ); Sun, 26 Jan 2020 06:36:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=V/lFF5hrEvAdEMq1he1DmotMHfWBcCLI8jmu0Yihs4E=; b=h22qdLw5L7b8dWgaZSifc50m7 C0bsCYVxQ2bf75NGRbd9N9DJ88sJKYS5MRDSXWiHxZKx+DyuHh1fDqumUtzQpii6Oq9Itnd1yJBDg Qnq2ZpeeN62ozuM+48SpY4aYPdTprFO2Yid7d4vdeukRDqToc4jAN6tIt8gJJsTpQXS/7U76gRZgT PN6jXJ7RiE7qFyWM6F1Dy3AWCbb6PddBdbAggeSmIMfCk7o3hd8A6uHoKP/Y877xiuK4+fdJ+SnT1 9UIQYaPic3bo943UfpqgI8AAcefE/uFTy+BNsWRZWyYn22IeKB6frOVnmPbmYkQdRZ3p0gBCTSb1O vygXuTYRQ==; Received: from [46.189.28.128] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ivgDH-0008Aq-SV for linux-xfs@vger.kernel.org; Sun, 26 Jan 2020 11:36:25 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 3/5] repair: remove BITS_PER_LONG cpp checks in bmap.[ch] Date: Sun, 26 Jan 2020 12:35:39 +0100 Message-Id: <20200126113541.787884-4-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200126113541.787884-1-hch@lst.de> References: <20200126113541.787884-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Add a little helper to validate the nex count so that we can use compile time magic checks for sizeof long directly. Also don't print the max in case of an overflow as the value will always be the same. Signed-off-by: Christoph Hellwig --- repair/bmap.c | 29 +++++++++++++++++++++-------- repair/bmap.h | 13 ------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/repair/bmap.c b/repair/bmap.c index 44e43ab4..0d717cd3 100644 --- a/repair/bmap.c +++ b/repair/bmap.c @@ -22,6 +22,22 @@ pthread_key_t dblkmap_key; pthread_key_t ablkmap_key; +/* + * For 32 bit platforms, we are limited to extent arrays of 2^31 bytes, which + * limits the number of extents in an inode we can check. If we don't limit the + * valid range, we can overflow the BLKMAP_SIZE() calculation and allocate less + * memory than we think we needed, and hence walk off the end of the array and + * corrupt memory. + */ +static inline bool +blkmap_nex_valid( + xfs_extnum_t nex) +{ + if (sizeof(long) < 64 && nex >= INT_MAX / sizeof(bmap_ext_t)) + return false; + return true; +} + blkmap_t * blkmap_alloc( xfs_extnum_t nex, @@ -35,8 +51,7 @@ blkmap_alloc( if (nex < 1) nex = 1; -#if (BITS_PER_LONG == 32) /* on 64-bit platforms this is never true */ - if (nex > BLKMAP_NEXTS_MAX) { + if (!blkmap_nex_valid(nex)) { do_warn( _("Number of extents requested in blkmap_alloc (%d) overflows 32 bits.\n" "If this is not a corruption, then you will need a 64 bit system\n" @@ -44,7 +59,6 @@ blkmap_alloc( nex); return NULL; } -#endif key = whichfork ? ablkmap_key : dblkmap_key; blkmap = pthread_getspecific(key); @@ -278,20 +292,19 @@ blkmap_grow( ASSERT(pthread_getspecific(key) == blkmap); } -#if (BITS_PER_LONG == 32) /* on 64-bit platforms this is never true */ - if (new_naexts > BLKMAP_NEXTS_MAX) { + if (!blkmap_nex_valid(new_naexts)) { do_error( _("Number of extents requested in blkmap_grow (%d) overflows 32 bits.\n" "You need a 64 bit system to repair this filesystem.\n"), new_naexts); return NULL; } -#endif + if (new_naexts <= 0) { do_error( _("Number of extents requested in blkmap_grow (%d) overflowed the\n" - "maximum number of supported extents (%d).\n"), - new_naexts, BLKMAP_NEXTS_MAX); + "maximum number of supported extents.\n"), + new_naexts); return NULL; } diff --git a/repair/bmap.h b/repair/bmap.h index 4b588df8..df9602b3 100644 --- a/repair/bmap.h +++ b/repair/bmap.h @@ -28,19 +28,6 @@ typedef struct blkmap { #define BLKMAP_SIZE(n) \ (offsetof(blkmap_t, exts) + (sizeof(bmap_ext_t) * (n))) -/* - * For 32 bit platforms, we are limited to extent arrays of 2^31 bytes, which - * limits the number of extents in an inode we can check. If we don't limit the - * valid range, we can overflow the BLKMAP_SIZE() calculation and allocate less - * memory than we think we needed, and hence walk off the end of the array and - * corrupt memory. - */ -#if BITS_PER_LONG == 32 -#define BLKMAP_NEXTS_MAX ((INT_MAX / sizeof(bmap_ext_t)) - 1) -#else -#define BLKMAP_NEXTS_MAX INT_MAX -#endif - extern pthread_key_t dblkmap_key; extern pthread_key_t ablkmap_key; From patchwork Sun Jan 26 11:35:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11351825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F37991398 for ; Sun, 26 Jan 2020 11:36:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7CE82075D for ; Sun, 26 Jan 2020 11:36:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="i/hFZA+A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387418AbgAZLgg (ORCPT ); Sun, 26 Jan 2020 06:36:36 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47278 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387416AbgAZLgg (ORCPT ); Sun, 26 Jan 2020 06:36:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gBZB3KppZ4QBoVpHGIOFPKet9GTGXtzkxdWnhAT7HVE=; b=i/hFZA+A8buWoYohKEBqceDKo qQU6eqQGas5hxF5/1/eC1ehDgFbNXc6DfdLno02JV+EgNFpc9YgYQoKZPV/d5h/d5Mc5BAh8668gh 4kq+DXaLZJXhbV7Z5S/xVI/sLKUKGnmHvIIuffMLcuKsjtWIzb9fTCeTT9nIsrfo4gRoBeWpV3ooB D2YaW2d0GRY/dk7M/ahileRUSVqP3d8nCCM0uILFAZxfnLlvSo9sk7uGwUY0rB1nDfJ2tYkrPOWcO mDhny7H3goT2AFbnJleseljGH9RUyMHgdmsTRxXDIK2ZmPuOlOFBfrfMOa2XBy+AexDDa+rYH8PIn ADEIuQ7Gg==; Received: from [46.189.28.128] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ivgDS-0008CB-Fw for linux-xfs@vger.kernel.org; Sun, 26 Jan 2020 11:36:36 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 4/5] xfsprogs: remove the SIZEOF_LONG substitution in platform_defs.h.in Date: Sun, 26 Jan 2020 12:35:40 +0100 Message-Id: <20200126113541.787884-5-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200126113541.787884-1-hch@lst.de> References: <20200126113541.787884-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org BITS_PER_LONG is now only checked in C expressions, so we can simply define it based on sizeof(long). Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- include/platform_defs.h.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index ff0a6a4e..36006cbf 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -26,9 +26,7 @@ typedef struct filldir filldir_t; -/* long and pointer must be either 32 bit or 64 bit */ -#undef SIZEOF_LONG -#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT) +#define BITS_PER_LONG (sizeof(long) * CHAR_BIT) /* Check whether to define umode_t ourselves. */ #ifndef HAVE_UMODE_T From patchwork Sun Jan 26 11:35:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11351827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A35A192A for ; Sun, 26 Jan 2020 11:36:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 822C22083E for ; Sun, 26 Jan 2020 11:36:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WaupjP/w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387419AbgAZLgr (ORCPT ); Sun, 26 Jan 2020 06:36:47 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47286 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387416AbgAZLgr (ORCPT ); Sun, 26 Jan 2020 06:36:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tI1xgn2vFOX75YS0soWfkrXVuxM6BsCw9IYdmDtTH1Q=; b=WaupjP/w6sm5ZpUx88qnFhI1L J75A37fs9aemQ9c+VxmSsM++t32Xu4gYmwg2/asuI/wnYK+yn5upADfZyRk2E9HyNoliSZR94jiYe aQPWseLFCOn+dOHwKOpvc5uX6waYi+sGhJsR7PCarfS75WzR+gZYsWGvKj/UGfRaKEFR9du3IfMK+ 8sgpM7OCXswvvR4dyn2XyflAftbikE8B+dL13OH5MtjHUfWRvG2nGMVqQH9FBR2kWVcBdsYtrO5Cl CyjgS0qVfXn99NW6bJb8gBGP8MT3eap4vpk47Y/HmTCR17ADVbvNaihhc4mHecctrw1rXjB0bMG7X ZnrbpkZaw==; Received: from [46.189.28.128] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ivgDd-0008Cy-47 for linux-xfs@vger.kernel.org; Sun, 26 Jan 2020 11:36:46 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 5/5] xfsprogs: stop generating platform_defs.h Date: Sun, 26 Jan 2020 12:35:41 +0100 Message-Id: <20200126113541.787884-6-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200126113541.787884-1-hch@lst.de> References: <20200126113541.787884-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Now that all the autoconf substituations are gone, there is no need to generate this (and thus any) header. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- .gitignore | 1 - Makefile | 15 ++++----------- configure.ac | 1 - debian/rules | 2 -- include/Makefile | 2 +- include/{platform_defs.h.in => platform_defs.h} | 0 6 files changed, 5 insertions(+), 16 deletions(-) rename include/{platform_defs.h.in => platform_defs.h} (100%) diff --git a/.gitignore b/.gitignore index fd131b6f..20d033ae 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ # build system .census .gitcensus -/include/platform_defs.h /include/builddefs /install-sh diff --git a/Makefile b/Makefile index 0edc2700..ff6a977d 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ SRCTARINC = m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 \ m4/ltversion.m4 po/xfsprogs.pot .gitcensus $(CONFIGURE) LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \ conftest* built .census install.* install-dev.* *.gz *.xz \ - autom4te.cache/* libtool include/builddefs include/platform_defs.h + autom4te.cache/* libtool include/builddefs ifeq ($(HAVE_BUILDDEFS), yes) LDIRDIRT = $(SRCDIR) @@ -84,7 +84,7 @@ endif # include is listed last so it is processed last in clean rules. SUBDIRS = $(LIBFROG_SUBDIR) $(LIB_SUBDIRS) $(TOOL_SUBDIRS) include -default: include/builddefs include/platform_defs.h +default: include/builddefs ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else @@ -130,13 +130,6 @@ configure: configure.ac include/builddefs: configure ./configure $$LOCAL_CONFIGURE_OPTIONS -include/platform_defs.h: include/builddefs -## Recover from the removal of $@ - @if test -f $@; then :; else \ - rm -f include/builddefs; \ - $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \ - fi - install: $(addsuffix -install,$(SUBDIRS)) $(INSTALL) -m 755 -d $(PKG_DOC_DIR) $(INSTALL) -m 644 README $(PKG_DOC_DIR) @@ -160,14 +153,14 @@ realclean: distclean # # All this gunk is to allow for a make dist on an unconfigured tree # -dist: include/builddefs include/platform_defs.h default +dist: include/builddefs default ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR) endif -deb: include/builddefs include/platform_defs.h +deb: include/builddefs ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else diff --git a/configure.ac b/configure.ac index 5eb7c14b..49c3a466 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,6 @@ AC_PREREQ(2.50) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([include/libxfs.h]) -AC_CONFIG_HEADER(include/platform_defs.h) AC_PREFIX_DEFAULT(/usr) AC_PROG_INSTALL diff --git a/debian/rules b/debian/rules index e8509fb3..41c0c004 100755 --- a/debian/rules +++ b/debian/rules @@ -43,14 +43,12 @@ config: .census @echo "== dpkg-buildpackage: configure" 1>&2 $(checkdir) AUTOHEADER=/bin/true dh_autoreconf - $(options) $(MAKE) $(PMAKEFLAGS) include/platform_defs.h touch .census dibuild: $(checkdir) @echo "== dpkg-buildpackage: installer" 1>&2 if [ ! -f mkfs/mkfs.xfs-$(bootpkg) ]; then \ - $(diopts) $(MAKE) include/platform_defs.h; \ mkdir -p include/xfs; \ for dir in include libxfs; do \ $(MAKE) $(PMAKEFLAGS) -C $$dir NODEP=1 install-headers; \ diff --git a/include/Makefile b/include/Makefile index a80867e4..c92ecbd5 100644 --- a/include/Makefile +++ b/include/Makefile @@ -37,7 +37,7 @@ HFILES = handle.h \ xqm.h \ xfs_arch.h -LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules install-sh +LSRCFILES = builddefs.in buildmacros buildrules install-sh LSRCFILES += $(DKHFILES) $(LIBHFILES) LDIRT = disk LDIRDIRT = xfs diff --git a/include/platform_defs.h.in b/include/platform_defs.h similarity index 100% rename from include/platform_defs.h.in rename to include/platform_defs.h