public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* struct fsxattr redefinition
@ 2016-05-18 16:37 Jeffrey Bastian
  2016-05-18 20:44 ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey Bastian @ 2016-05-18 16:37 UTC (permalink / raw)
  To: xfs

There was a discussion a few months ago about adding a guard for the
fsxattr struct [0] because it's defined in two places, the Linux kernel
header linux/fs.h [1] and xfsprogs header xfs/linux.h [2].

xfs/linux.h has a FS_IOC_FSGETXATTR guard around the struct fsxattr
definition, but this only works if linux/fs.h is included *before*
xfs/linux.h (or xfs/xfs.h).  If you include linux/fs.h after, then you
get a struct redefinition error.

Is it a requirement that linux/fs.h is included first?  If so, then
there is a bug in xfstests because it includes them in the wrong order
[3] and fails to build.  If there is not an order requirement, then both
header files should probably have a HAVE_FSXATTR guard around the struct
definition.

[0] http://oss.sgi.com/archives/xfs/2016-02/msg00306.html
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fs.h?h=v4.6#n152
[2] http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=blob;f=include/linux.h;h=cc0f70ceed72406822885d878b939b3e66c03ffd;hb=53cefc406eb1047ce9dc85906a0117f8da9f44ca#l177
[3] http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfstests.git;a=blob;f=src/t_immutable.c;h=87ffc75f2d0229941ad6c5235ce9deea272d66c9;hb=HEAD#l41

-- 
Jeff Bastian

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2016-05-18 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18 16:37 struct fsxattr redefinition Jeffrey Bastian
2016-05-18 20:44 ` Eric Sandeen
2016-05-18 22:06   ` Jeffrey Bastian
2016-05-18 23:34   ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox