]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/xfsprogs/0006-xfs_scrub-fix-build-with-older-kernel-headers.patch
xfsprogs: fix build with older kernel headers
[coffee/buildroot.git] / package / xfsprogs / 0006-xfs_scrub-fix-build-with-older-kernel-headers.patch
1 From 7ea1df02d0f2549b6249c8bee1f6ae02bf1251a9 Mon Sep 17 00:00:00 2001
2 From: Baruch Siach <baruch@tkos.co.il>
3 Date: Sun, 25 Mar 2018 00:01:23 +0300
4 Subject: [PATCH] xfs_scrub: fix build with older kernel headers
5
6 The OVERRIDE_SYSTEM_FSXATTR macro in include/linux.h is meant to
7 override the linux/fs.h kernel header provided struct fsxattr for
8 kernels older than v4.7. A few source files include linux/fs.h before
9 the local linux.h, making this override ineffective. Remove these header
10 includes from the source files, and rely on the linux.h include alone.
11
12 This fixes the following build failures:
13
14 In file included from ../include/xfs.h:37:0,
15                  from disk.c:40:
16 ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr'
17  struct fsxattr {
18         ^~~~~~~
19
20 In file included from ../include/xfs.h:37:0,
21                  from ../include/project.h:22,
22                  from ../include/input.h:24,
23                  from phase1.c:38:
24 ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr'
25  struct fsxattr {
26         ^~~~~~~
27
28 Cc: Darrick J. Wong <darrick.wong@oracle.com>
29 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
30 ---
31 Upstream status: https://patchwork.kernel.org/patch/10306419/
32
33  scrub/disk.c   | 1 -
34  scrub/phase1.c | 1 -
35  2 files changed, 2 deletions(-)
36
37 diff --git a/scrub/disk.c b/scrub/disk.c
38 index e12175c8656c..54d7a2a77c45 100644
39 --- a/scrub/disk.c
40 +++ b/scrub/disk.c
41 @@ -28,7 +28,6 @@
42  #include <sys/ioctl.h>
43  #include <sys/statvfs.h>
44  #include <sys/vfs.h>
45 -#include <linux/fs.h>
46  #ifdef HAVE_SG_IO
47  # include <scsi/sg.h>
48  #endif
49 diff --git a/scrub/phase1.c b/scrub/phase1.c
50 index 6cd544233c94..d15689e1b544 100644
51 --- a/scrub/phase1.c
52 +++ b/scrub/phase1.c
53 @@ -32,7 +32,6 @@
54  #include <stdbool.h>
55  #include <pthread.h>
56  #include <errno.h>
57 -#include <linux/fs.h>
58  #include "libfrog.h"
59  #include "workqueue.h"
60  #include "input.h"
61 -- 
62 2.16.2
63