linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs_scrub: fix build with older kernel headers
@ 2018-03-24 21:08 Baruch Siach
  2018-03-26 18:09 ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Siach @ 2018-03-24 21:08 UTC (permalink / raw)
  To: linux-xfs; +Cc: Baruch Siach, Darrick J . Wong

The OVERRIDE_SYSTEM_FSXATTR macro in include/linux.h is meant to
override the linux/fs.h kernel header provided struct fsxattr for
kernels older than v4.7. A few source files include linux/fs.h before
the local linux.h, making this override ineffective. Remove these header
includes from the source files, and rely on the linux.h include alone.

This fixes the following build failures:

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 ../include/xfs.h:37:0,
                 from ../include/project.h:22,
                 from ../include/input.h:24,
                 from phase1.c:38:
../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr'
 struct fsxattr {
        ^~~~~~~

Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 scrub/disk.c   | 1 -
 scrub/phase1.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/scrub/disk.c b/scrub/disk.c
index e12175c8656c..54d7a2a77c45 100644
--- a/scrub/disk.c
+++ b/scrub/disk.c
@@ -28,7 +28,6 @@
 #include <sys/ioctl.h>
 #include <sys/statvfs.h>
 #include <sys/vfs.h>
-#include <linux/fs.h>
 #ifdef HAVE_SG_IO
 # include <scsi/sg.h>
 #endif
diff --git a/scrub/phase1.c b/scrub/phase1.c
index 6cd544233c94..d15689e1b544 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -32,7 +32,6 @@
 #include <stdbool.h>
 #include <pthread.h>
 #include <errno.h>
-#include <linux/fs.h>
 #include "libfrog.h"
 #include "workqueue.h"
 #include "input.h"
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_scrub: fix build with older kernel headers
  2018-03-24 21:08 [PATCH] xfs_scrub: fix build with older kernel headers Baruch Siach
@ 2018-03-26 18:09 ` Darrick J. Wong
  2018-03-27  1:44   ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2018-03-26 18:09 UTC (permalink / raw)
  To: Baruch Siach; +Cc: linux-xfs

On Sun, Mar 25, 2018 at 12:08:17AM +0300, Baruch Siach wrote:
> The OVERRIDE_SYSTEM_FSXATTR macro in include/linux.h is meant to
> override the linux/fs.h kernel header provided struct fsxattr for
> kernels older than v4.7. A few source files include linux/fs.h before
> the local linux.h, making this override ineffective. Remove these header
> includes from the source files, and rely on the linux.h include alone.
> 
> This fixes the following build failures:
> 
> 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 ../include/xfs.h:37:0,
>                  from ../include/project.h:22,
>                  from ../include/input.h:24,
>                  from phase1.c:38:
> ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr'
>  struct fsxattr {
>         ^~~~~~~
> 
> Cc: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Looks ok, but I think this is already fixed by commit a440f8773794
("xfs_scrub: fix #include ordering to avoid build failure") in for-next.

--D

> ---
>  scrub/disk.c   | 1 -
>  scrub/phase1.c | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/scrub/disk.c b/scrub/disk.c
> index e12175c8656c..54d7a2a77c45 100644
> --- a/scrub/disk.c
> +++ b/scrub/disk.c
> @@ -28,7 +28,6 @@
>  #include <sys/ioctl.h>
>  #include <sys/statvfs.h>
>  #include <sys/vfs.h>
> -#include <linux/fs.h>
>  #ifdef HAVE_SG_IO
>  # include <scsi/sg.h>
>  #endif
> diff --git a/scrub/phase1.c b/scrub/phase1.c
> index 6cd544233c94..d15689e1b544 100644
> --- a/scrub/phase1.c
> +++ b/scrub/phase1.c
> @@ -32,7 +32,6 @@
>  #include <stdbool.h>
>  #include <pthread.h>
>  #include <errno.h>
> -#include <linux/fs.h>
>  #include "libfrog.h"
>  #include "workqueue.h"
>  #include "input.h"
> -- 
> 2.16.2
> 
> --
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_scrub: fix build with older kernel headers
  2018-03-26 18:09 ` Darrick J. Wong
@ 2018-03-27  1:44   ` Eric Sandeen
  2018-03-28 20:07     ` Baruch Siach
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2018-03-27  1:44 UTC (permalink / raw)
  To: Darrick J. Wong, Baruch Siach; +Cc: linux-xfs



On 3/26/18 1:09 PM, Darrick J. Wong wrote:
> On Sun, Mar 25, 2018 at 12:08:17AM +0300, Baruch Siach wrote:
>> The OVERRIDE_SYSTEM_FSXATTR macro in include/linux.h is meant to
>> override the linux/fs.h kernel header provided struct fsxattr for
>> kernels older than v4.7. A few source files include linux/fs.h before
>> the local linux.h, making this override ineffective. Remove these header
>> includes from the source files, and rely on the linux.h include alone.
>>
>> This fixes the following build failures:
>>
>> 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 ../include/xfs.h:37:0,
>>                  from ../include/project.h:22,
>>                  from ../include/input.h:24,
>>                  from phase1.c:38:
>> ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr'
>>  struct fsxattr {
>>         ^~~~~~~
>>
>> Cc: Darrick J. Wong <darrick.wong@oracle.com>
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> 
> Looks ok, but I think this is already fixed by commit a440f8773794
> ("xfs_scrub: fix #include ordering to avoid build failure") in for-next.

Agreed, it looks like this is against master & not for-next;
Baruch, can you check out for-next and confirm that it's ok?

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_scrub: fix build with older kernel headers
  2018-03-27  1:44   ` Eric Sandeen
@ 2018-03-28 20:07     ` Baruch Siach
  2018-03-28 20:12       ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Siach @ 2018-03-28 20:07 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Darrick J. Wong, linux-xfs

Hi Eric,

On Mon, Mar 26, 2018 at 08:44:46PM -0500, Eric Sandeen wrote:
> On 3/26/18 1:09 PM, Darrick J. Wong wrote:
> > On Sun, Mar 25, 2018 at 12:08:17AM +0300, Baruch Siach wrote:
> >> The OVERRIDE_SYSTEM_FSXATTR macro in include/linux.h is meant to
> >> override the linux/fs.h kernel header provided struct fsxattr for
> >> kernels older than v4.7. A few source files include linux/fs.h before
> >> the local linux.h, making this override ineffective. Remove these header
> >> includes from the source files, and rely on the linux.h include alone.
> >>
> >> This fixes the following build failures:
> >>
> >> 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 ../include/xfs.h:37:0,
> >>                  from ../include/project.h:22,
> >>                  from ../include/input.h:24,
> >>                  from phase1.c:38:
> >> ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr'
> >>  struct fsxattr {
> >>         ^~~~~~~
> >>
> >> Cc: Darrick J. Wong <darrick.wong@oracle.com>
> >> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > 
> > Looks ok, but I think this is already fixed by commit a440f8773794
> > ("xfs_scrub: fix #include ordering to avoid build failure") in for-next.
> 
> Agreed, it looks like this is against master & not for-next;
> Baruch, can you check out for-next and confirm that it's ok?

Yes. I verified that commit a440f8773794 (slightly modified to apply to 
v4.15.1) fixes build with the affected toolchain.

Thanks,
baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_scrub: fix build with older kernel headers
  2018-03-28 20:07     ` Baruch Siach
@ 2018-03-28 20:12       ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2018-03-28 20:12 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Darrick J. Wong, linux-xfs

On 3/28/18 3:07 PM, Baruch Siach wrote:
> Hi Eric,
> 

...

> Yes. I verified that commit a440f8773794 (slightly modified to apply to 
> v4.15.1) fixes build with the affected toolchain.

Thank you!

-Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-28 20:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-24 21:08 [PATCH] xfs_scrub: fix build with older kernel headers Baruch Siach
2018-03-26 18:09 ` Darrick J. Wong
2018-03-27  1:44   ` Eric Sandeen
2018-03-28 20:07     ` Baruch Siach
2018-03-28 20:12       ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).