From ca7c8bcbe851b2795357ce0137ead4199fe69808 Mon Sep 17 00:00:00 2001 From: Jeffrey Bastian Date: Wed, 18 May 2016 12:40:54 -0500 Subject: [PATCH] build: avoid struct fsxattr redefinition Linux kernel v4.5 defines 'struct fsxattr' in linux/fs.h [0] but it's still defined in xfs/linux.h as a backup [1]. If the files are included in the wrong order, the compiler will complain with a redefinition error. This patch moves linux/fs.h (and linux/magic.h) before the xfs headers for the t_immutable.c and fsstress.c tests. [0] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=334e580a6f97e [1] http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=blob;f=include/linux.h;h=cc0f70ceed72#l183 Signed-off-by: Jeffrey Bastian Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- ltp/fsstress.c | 2 +- src/t_immutable.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 1e6c9132..7e7cf608 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "global.h" #ifdef HAVE_ATTR_XATTR_H @@ -34,7 +35,6 @@ #include #endif -#include #ifndef FS_IOC_GETFLAGS #define FS_IOC_GETFLAGS _IOR('f', 1, long) #endif diff --git a/src/t_immutable.c b/src/t_immutable.c index 87ffc75f..7fd9e5dd 100644 --- a/src/t_immutable.c +++ b/src/t_immutable.c @@ -38,11 +38,11 @@ #include #include #include +#include +#include #include #include #include -#include -#include #ifndef XFS_SUPER_MAGIC #define XFS_SUPER_MAGIC 0x58465342 -- 2.30.2