mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6.11-rc4 i386] Re-order <linux/fs.h> includes to fix userland breakage
@ 2005-02-22 21:51 Tom Rini
  2005-02-23  1:36 ` Chris Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2005-02-22 21:51 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, Kernel Mailing List

The following moves all includes <linux/fs.h> (except <linux/ioctl.h>
and <linux/config.h> down to below the existing __KERNEL__ test.  None
of these includes are needed by the user-visible portions of the header,
and in some cases can cause userland apps to break.  For example, LTP
and sash with an empty <linux/autoconf.h> will fail thusly:
cc -Wall  -I../../include -g -Wall -I../../../../include -Wall    setrlimit02.c -L../../../../lib -lltp  -o setrlimit02
In file included from /usr/include/asm/atomic.h:6,
                 from /usr/include/linux/fs.h:20,
                 from setrlimit02.c:46:
/usr/include/asm/processor.h:68: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
/usr/include/asm/processor.h:68: error: requested alignment is not a constant

Build/run tested with a glibc rebuild as well.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>

===== include/linux/fs.h 1.376 vs edited =====
--- 1.376/include/linux/fs.h	2005-02-03 07:42:40 -07:00
+++ edited/include/linux/fs.h	2005-02-22 14:44:27 -07:00
@@ -7,25 +7,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/linkage.h>
-#include <linux/limits.h>
-#include <linux/wait.h>
-#include <linux/types.h>
-#include <linux/kdev_t.h>
 #include <linux/ioctl.h>
-#include <linux/dcache.h>
-#include <linux/stat.h>
-#include <linux/cache.h>
-#include <linux/kobject.h>
-#include <asm/atomic.h>
-
-struct iovec;
-struct nameidata;
-struct pipe_inode_info;
-struct poll_table_struct;
-struct kstatfs;
-struct vm_area_struct;
-struct vfsmount;
 
 /*
  * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -216,13 +198,32 @@ extern int dir_notify_enable;
 
 #ifdef __KERNEL__
 
+#include <linux/linkage.h>
+#include <linux/limits.h>
+#include <linux/wait.h>
+#include <linux/types.h>
+#include <linux/kdev_t.h>
+#include <linux/dcache.h>
+#include <linux/stat.h>
+#include <linux/cache.h>
+#include <linux/kobject.h>
 #include <linux/list.h>
 #include <linux/radix-tree.h>
 #include <linux/prio_tree.h>
 #include <linux/audit.h>
 #include <linux/init.h>
+
+#include <asm/atomic.h>
 #include <asm/semaphore.h>
 #include <asm/byteorder.h>
+
+struct iovec;
+struct nameidata;
+struct pipe_inode_info;
+struct poll_table_struct;
+struct kstatfs;
+struct vm_area_struct;
+struct vfsmount;
 
 /* Used to be a macro which just called the function, now just a function */
 extern void update_atime (struct inode *);

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [2.6.11-rc4 i386] Re-order <linux/fs.h> includes to fix userland breakage
  2005-02-22 21:51 [2.6.11-rc4 i386] Re-order <linux/fs.h> includes to fix userland breakage Tom Rini
@ 2005-02-23  1:36 ` Chris Wright
  2005-02-23  1:48   ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wright @ 2005-02-23  1:36 UTC (permalink / raw)
  To: Tom Rini; +Cc: Linus Torvalds, Andrew Morton, Kernel Mailing List

* Tom Rini (trini@kernel.crashing.org) wrote:
> The following moves all includes <linux/fs.h> (except <linux/ioctl.h>
> and <linux/config.h> down to below the existing __KERNEL__ test.  None
> of these includes are needed by the user-visible portions of the header,
> and in some cases can cause userland apps to break.  For example, LTP
> and sash with an empty <linux/autoconf.h> will fail thusly:
> cc -Wall  -I../../include -g -Wall -I../../../../include -Wall    setrlimit02.c -L../../../../lib -lltp  -o setrlimit02
> In file included from /usr/include/asm/atomic.h:6,
>                  from /usr/include/linux/fs.h:20,
>                  from setrlimit02.c:46:
> /usr/include/asm/processor.h:68: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
> /usr/include/asm/processor.h:68: error: requested alignment is not a constant

This change is spewing warnings like:

  CC      init/main.o
In file included from include/linux/fs.h:202,
                 from include/linux/proc_fs.h:6,
                 from init/main.c:17:
include/linux/limits.h:4:1: warning: "NR_OPEN" redefined
In file included from include/linux/proc_fs.h:6,
                 from init/main.c:17:
include/linux/fs.h:24:1: warning: this is the location of the previous definition
  CC      init/do_mounts.o
In file included from include/linux/fs.h:202,
                 from include/linux/tty.h:20,
                 from init/do_mounts.c:5:
include/linux/limits.h:4:1: warning: "NR_OPEN" redefined
In file included from include/linux/tty.h:20,
                 from init/do_mounts.c:5:
include/linux/fs.h:24:1: warning: this is the location of the previous definition

Move limits.h include back above __KERNEL__ to quiet things back down.

Signed-off-by: Chris Wright <chrisw@osdl.org>

===== include/linux/fs.h 1.377 vs edited =====
--- 1.377/include/linux/fs.h	2005-02-22 13:44:27 -08:00
+++ edited/include/linux/fs.h	2005-02-22 17:26:03 -08:00
@@ -8,6 +8,7 @@
 
 #include <linux/config.h>
 #include <linux/ioctl.h>
+#include <linux/limits.h>
 
 /*
  * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -199,7 +200,6 @@ extern int dir_notify_enable;
 #ifdef __KERNEL__
 
 #include <linux/linkage.h>
-#include <linux/limits.h>
 #include <linux/wait.h>
 #include <linux/types.h>
 #include <linux/kdev_t.h>

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

* Re: [2.6.11-rc4 i386] Re-order <linux/fs.h> includes to fix userland breakage
  2005-02-23  1:36 ` Chris Wright
@ 2005-02-23  1:48   ` Linus Torvalds
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2005-02-23  1:48 UTC (permalink / raw)
  To: Chris Wright; +Cc: Tom Rini, Andrew Morton, Kernel Mailing List



On Tue, 22 Feb 2005, Chris Wright wrote:
> 
> This change is spewing warnings like:

Already fixed in BK.

		Linus

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

end of thread, other threads:[~2005-02-23  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 21:51 [2.6.11-rc4 i386] Re-order <linux/fs.h> includes to fix userland breakage Tom Rini
2005-02-23  1:36 ` Chris Wright
2005-02-23  1:48   ` Linus Torvalds

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

all inboxes | Powered by JetHome®