From patchwork Thu Mar 1 19:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10252231 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 D01B56037D for ; Thu, 1 Mar 2018 19:13:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDEB028533 for ; Thu, 1 Mar 2018 19:13:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B24052852C; Thu, 1 Mar 2018 19:13:41 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 612C82852C for ; Thu, 1 Mar 2018 19:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161207AbeCATNf (ORCPT ); Thu, 1 Mar 2018 14:13:35 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:55588 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161161AbeCATNc (ORCPT ); Thu, 1 Mar 2018 14:13:32 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w21JCVJ5142598; Thu, 1 Mar 2018 19:13:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=uFCmUtjP7b4DVWAZKxY+2C+YtgnntSuc1iwmeTjGgZQ=; b=Jrpxq+rDAr60l5hwkQcTE5OshxXaqjGjoD8tInui6d6ACXEwsTTMkv/x4riErEFtprWV EfdxD8sdzsJMF5vdSqGk8zKCFnmK3JhCWLujUUJ4P8UCOOHEAPwxMZGW69VVRXx8DHtg M0bR2BkENJgxHtJBTWA7+U2tdh/i4mcL8kUiuHmfOVXeEkX63uGtfpZn+X2Es89ruzst ujUGf/dbCVBWYGm2e97MHGg+WFpGsH0e0zqYMokBwJZ62/19vAQkN0Fk5+M24dD3qKIZ nlyMrNOGxswt8R+7uKEPOFF4RdnCjh1TXIXMawYUXu2KqGPdPwz5G0v/oIql5t4QCAwY JQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2gepqfr74c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Mar 2018 19:13:28 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w21JDSlu001732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Mar 2018 19:13:28 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w21JDRRV016935; Thu, 1 Mar 2018 19:13:28 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 11:13:27 -0800 Subject: [PATCH 05/16] xfs_scrub: fix #include ordering to avoid build failure From: "Darrick J. Wong" To: sandeen@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, djwong@kernel.org, Mikael Magnusson Date: Thu, 01 Mar 2018 11:13:26 -0800 Message-ID: <151993160650.22223.13639058352038800793.stgit@magnolia> In-Reply-To: <151993157539.22223.6269629008244777191.stgit@magnolia> References: <151993157539.22223.6269629008244777191.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8819 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803010237 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 Fix the ordering of the header includes in all the scrub source. We put xfs.h first so that it will pull in include/linux.h which pulls in linux/fs.h + whatever overrides are necessary (currently limited to struct fsxattr) to make things work on this platform, and then we remove the #includes for anything that will get pulled (directly or indirectly) by xfs.h for cleanliness. Without this, a user compiling new xfsprogs on a system with a 4.7 kernel gets this: Building scrub [CC] disk.o In file included from ../include/xfs.h:37:0, from disk.c:40: ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr' struct fsxattr { ^~~~~~~ In file included from disk.c:31:0: /usr/include/linux/fs.h:155:8: note: originally defined here struct fsxattr { ^~~~~~~ gmake[2]: *** [../include/buildrules:60: disk.o] Error 1 gmake[1]: *** [include/buildrules:36: scrub] Error 2 make: *** [Makefile:77: default] Error 2 Reported-by: Mikael Magnusson Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- scrub/bitmap.c | 5 +---- scrub/common.c | 5 +---- scrub/counter.c | 2 +- scrub/disk.c | 9 +-------- scrub/filemap.c | 6 +----- scrub/fscounters.c | 5 +---- scrub/inodes.c | 4 +--- scrub/phase1.c | 10 +--------- scrub/phase2.c | 5 +---- scrub/phase3.c | 5 +---- scrub/phase4.c | 6 +----- scrub/phase5.c | 5 +---- scrub/phase6.c | 5 +---- scrub/phase7.c | 5 +---- scrub/progress.c | 4 +--- scrub/read_verify.c | 5 +---- scrub/scrub.c | 6 +----- scrub/spacemap.c | 5 +---- scrub/unicrash.c | 5 +---- scrub/vfs.c | 4 +--- scrub/xfs_scrub.c | 5 +---- 21 files changed, 21 insertions(+), 90 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/scrub/bitmap.c b/scrub/bitmap.c index a88fd0e..212c3b8 100644 --- a/scrub/bitmap.c +++ b/scrub/bitmap.c @@ -17,13 +17,10 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include -#include #include -#include #include #include "platform_defs.h" #include "avl64.h" diff --git a/scrub/common.c b/scrub/common.c index 672f286..32f7642 100644 --- a/scrub/common.c +++ b/scrub/common.c @@ -17,14 +17,11 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include #include "platform_defs.h" -#include "xfs.h" -#include "xfs_fs.h" #include "path.h" #include "xfs_scrub.h" #include "common.h" diff --git a/scrub/counter.c b/scrub/counter.c index ced3cf3..0e28f0f 100644 --- a/scrub/counter.c +++ b/scrub/counter.c @@ -17,9 +17,9 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "xfs.h" #include #include -#include #include #include #include diff --git a/scrub/disk.c b/scrub/disk.c index e12175c..798b4a0 100644 --- a/scrub/disk.c +++ b/scrub/disk.c @@ -17,18 +17,13 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include #include -#include #include #include #include -#include -#include #include -#include -#include #ifdef HAVE_SG_IO # include #endif @@ -37,9 +32,7 @@ #endif #include "platform_defs.h" #include "libfrog.h" -#include "xfs.h" #include "path.h" -#include "xfs_fs.h" #include "xfs_scrub.h" #include "common.h" #include "disk.h" diff --git a/scrub/filemap.c b/scrub/filemap.c index f42a6ba..056b3b0 100644 --- a/scrub/filemap.c +++ b/scrub/filemap.c @@ -17,17 +17,13 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include #include #include #include -#include #include -#include "xfs.h" -#include "xfs_fs.h" #include "path.h" #include "xfs_scrub.h" #include "common.h" diff --git a/scrub/fscounters.c b/scrub/fscounters.c index ecdf4c6..05bf95e 100644 --- a/scrub/fscounters.c +++ b/scrub/fscounters.c @@ -17,15 +17,12 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include #include #include "platform_defs.h" -#include "xfs.h" #include "xfs_arch.h" -#include "xfs_fs.h" #include "xfs_format.h" #include "path.h" #include "workqueue.h" diff --git a/scrub/inodes.c b/scrub/inodes.c index 744b003..ccfb9e0 100644 --- a/scrub/inodes.c +++ b/scrub/inodes.c @@ -17,14 +17,12 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include #include #include #include "platform_defs.h" -#include "xfs.h" #include "xfs_arch.h" #include "xfs_format.h" #include "handle.h" diff --git a/scrub/phase1.c b/scrub/phase1.c index 6cd5442..5ddce6e 100644 --- a/scrub/phase1.c +++ b/scrub/phase1.c @@ -17,30 +17,22 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include -#include #include #include #include -#include #include #include #include -#include #include -#include -#include #include "libfrog.h" #include "workqueue.h" #include "input.h" #include "path.h" #include "handle.h" #include "bitops.h" -#include "xfs_arch.h" -#include "xfs_format.h" #include "avl64.h" #include "list.h" #include "xfs_scrub.h" diff --git a/scrub/phase2.c b/scrub/phase2.c index edf66df..ad736bf 100644 --- a/scrub/phase2.c +++ b/scrub/phase2.c @@ -17,13 +17,10 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include -#include #include -#include "xfs.h" #include "list.h" #include "path.h" #include "workqueue.h" diff --git a/scrub/phase3.c b/scrub/phase3.c index a0ee5d9..68c95e6 100644 --- a/scrub/phase3.c +++ b/scrub/phase3.c @@ -17,13 +17,10 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include -#include #include -#include "xfs.h" #include "list.h" #include "path.h" #include "workqueue.h" diff --git a/scrub/phase4.c b/scrub/phase4.c index 1fb8da9..8573036 100644 --- a/scrub/phase4.c +++ b/scrub/phase4.c @@ -17,15 +17,11 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include -#include #include -#include "xfs.h" -#include "xfs_fs.h" #include "list.h" #include "path.h" #include "workqueue.h" diff --git a/scrub/phase5.c b/scrub/phase5.c index 703b279..0ef6339 100644 --- a/scrub/phase5.c +++ b/scrub/phase5.c @@ -17,17 +17,14 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include -#include #include #ifdef HAVE_LIBATTR # include #endif -#include "xfs.h" #include "handle.h" #include "list.h" #include "path.h" diff --git a/scrub/phase6.c b/scrub/phase6.c index e255eef..b533cbb 100644 --- a/scrub/phase6.c +++ b/scrub/phase6.c @@ -17,13 +17,10 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include -#include "xfs.h" -#include "xfs_fs.h" #include "handle.h" #include "path.h" #include "ptvar.h" diff --git a/scrub/phase7.c b/scrub/phase7.c index 460ca8a..50d04ae 100644 --- a/scrub/phase7.c +++ b/scrub/phase7.c @@ -17,13 +17,10 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include -#include "xfs.h" -#include "xfs_fs.h" #include "path.h" #include "ptvar.h" #include "xfs_scrub.h" diff --git a/scrub/progress.c b/scrub/progress.c index 61b9c60..e9e720b 100644 --- a/scrub/progress.c +++ b/scrub/progress.c @@ -17,13 +17,11 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "libxfs.h" -#include +#include "xfs.h" #include #include #include #include -#include "../repair/threads.h" #include "path.h" #include "disk.h" #include "read_verify.h" diff --git a/scrub/read_verify.c b/scrub/read_verify.c index ae2e85f..d7bcc17 100644 --- a/scrub/read_verify.c +++ b/scrub/read_verify.c @@ -17,15 +17,12 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include #include "workqueue.h" #include "path.h" -#include "xfs.h" -#include "xfs_fs.h" #include "xfs_scrub.h" #include "common.h" #include "counter.h" diff --git a/scrub/scrub.c b/scrub/scrub.c index ff5357c..9e82675 100644 --- a/scrub/scrub.c +++ b/scrub/scrub.c @@ -17,17 +17,13 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include #include #include #include -#include #include -#include "xfs.h" -#include "xfs_fs.h" #include "list.h" #include "path.h" #include "xfs_scrub.h" diff --git a/scrub/spacemap.c b/scrub/spacemap.c index f631913..3621035 100644 --- a/scrub/spacemap.c +++ b/scrub/spacemap.c @@ -17,15 +17,12 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include "xfs.h" #include #include #include #include #include "workqueue.h" -#include "xfs.h" -#include "xfs_fs.h" #include "path.h" #include "xfs_scrub.h" #include "common.h" diff --git a/scrub/unicrash.c b/scrub/unicrash.c index ce3e7f9..0b5d1fa 100644 --- a/scrub/unicrash.c +++ b/scrub/unicrash.c @@ -17,17 +17,14 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include #include -#include #include #include #include -#include "xfs.h" #include "path.h" #include "xfs_scrub.h" #include "common.h" diff --git a/scrub/vfs.c b/scrub/vfs.c index 0c5b353..cfb5878 100644 --- a/scrub/vfs.c +++ b/scrub/vfs.c @@ -17,13 +17,11 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include #include -#include "xfs.h" #include "handle.h" #include "path.h" #include "workqueue.h" diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index 53a105a..df58db5 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -17,16 +17,13 @@ * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xfs.h" #include -#include #include #include #include #include #include "platform_defs.h" -#include "xfs.h" -#include "xfs_fs.h" #include "input.h" #include "path.h" #include "xfs_scrub.h"