]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - scrub/phase2.c
xfs_scrub: fix #include ordering to avoid build failure
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 9 Mar 2018 02:35:23 +0000 (20:35 -0600)
committerEric Sandeen <sandeen@redhat.com>
Fri, 9 Mar 2018 02:35:23 +0000 (20:35 -0600)
commita440f87737944bc2b4f1ce0b4dae7698703f0fdc
treef58b80e3cdbd341d0312bb6a5acd213e457d8eb5
parentc767c5aee0427c117b9338a62a5f140befd15aaa
xfs_scrub: fix #include ordering to avoid build failure

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 <mikachu@gmail.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
21 files changed:
scrub/bitmap.c
scrub/common.c
scrub/counter.c
scrub/disk.c
scrub/filemap.c
scrub/fscounters.c
scrub/inodes.c
scrub/phase1.c
scrub/phase2.c
scrub/phase3.c
scrub/phase4.c
scrub/phase5.c
scrub/phase6.c
scrub/phase7.c
scrub/progress.c
scrub/read_verify.c
scrub/scrub.c
scrub/spacemap.c
scrub/unicrash.c
scrub/vfs.c
scrub/xfs_scrub.c