Skip to contentSkip to conversation

compat_ioctl requires CONFIG_BLOCK

PATCH In review Sebastian Siewior 5 participants 7 messages Jul 20, 2007 – Jul 24, 2007 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 compat_ioctl requires CONFIG_BLOCK

Got with randconfig
include/linux/loop.h:66: error: expected specifier-qualifier-list before 'request_queue_t'
make[1]: *** [fs/compat_ioctl.o] Error 1

parts of compat ioctl require CONFIG_BLOCK to be set.

fs/compat_ioctl.c +4 -0
Index: b/fs/compat_ioctl.c
===================================================================
@@ -63,7 +63,9 @@
 #include <linux/wireless.h>
 #include <linux/atalk.h>
 #include <linux/blktrace_api.h>
+#ifdef CONFIG_BLOCK
 #include <linux/loop.h>
+#endif
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci.h>
@@ -3491,8 +3493,10 @@ HANDLE_IOCTL(LPSETTIMEOUT, lp_timeout_tr
 IGNORE_IOCTL(VFAT_IOCTL_READDIR_BOTH32)
 IGNORE_IOCTL(VFAT_IOCTL_READDIR_SHORT32)
 
+#ifdef CONFIG_BLOCK
 /* loop */
 IGNORE_IOCTL(LOOP_CLR_FD)
+#endif
 };
 
 #define IOCTL_HASHSIZE 256
#1 lore raw
Quoted 14 lines · Sebastian Siewior

Got with randconfig
include/linux/loop.h:66: error: expected specifier-qualifier-list before 'request_queue_t'
make[1]: *** [fs/compat_ioctl.o] Error 1

parts of compat ioctl require CONFIG_BLOCK to be set.

Index: b/fs/compat_ioctl.c
===================================================================

fs/compat_ioctl.c line 68

Quoted 6 lines
fs/compat_ioctl.c +2 -0
@@ -63,7 +63,9 @@
  #include <linux/wireless.h>
  #include <linux/atalk.h>
  #include <linux/blktrace_api.h>
+#ifdef CONFIG_BLOCK
  #include <linux/loop.h>
+#endif

Adding #ifdef around an #include is considered bad style. Better just make loop.h compile without any conditionals. Does the below patch work for you?

	Arnd <><
include/linux/loop.h +1 -1
@@ -63,7 +63,7 @@ struct loop_device {
 	struct task_struct	*lo_thread;
 	wait_queue_head_t	lo_event;
 
-	request_queue_t		*lo_queue;
+	struct request_queue	*lo_queue;
 	struct gendisk		*lo_disk;
 	struct list_head	lo_list;
 };
#2 lore raw
Quoted 9 lines · * Arnd Bergmann | 2007-07-21 01:08:57 [+0200]:
Quoted 8 lines · Sebastian Siewior

Got with randconfig
include/linux/loop.h:66: error: expected specifier-qualifier-list before 'request_queue_t'
make[1]: *** [fs/compat_ioctl.o] Error 1

parts of compat ioctl require CONFIG_BLOCK to be set.

Quoted 17 lines

fs/compat_ioctl.c line 68

Quoted 12 lines

Index: b/fs/compat_ioctl.c
===================================================================

fs/compat_ioctl.c +2 -0
@@ -63,7 +63,9 @@
  #include <linux/wireless.h>
  #include <linux/atalk.h>
  #include <linux/blktrace_api.h>
+#ifdef CONFIG_BLOCK
  #include <linux/loop.h>
+#endif

Adding #ifdef around an #include is considered bad style. Better just make loop.h compile without any conditionals. Does the below patch work for you?

Yes it does.

Quoted 1 line
	Arnd <><

Sebastian

Quoted 12 lines
include/linux/loop.h +1 -1
@@ -63,7 +63,7 @@ struct loop_device {
 	struct task_struct	*lo_thread;
 	wait_queue_head_t	lo_event;
 
-	request_queue_t		*lo_queue;
+	struct request_queue	*lo_queue;
 	struct gendisk		*lo_disk;
 	struct list_head	lo_list;
 };
#3 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Sebastian Siewior

Got with randconfig
include/linux/loop.h:66: error: expected specifier-qualifier-list before 'request_queue_t'
make[1]: *** [fs/compat_ioctl.o] Error 1

parts of compat ioctl require CONFIG_BLOCK to be set.

Quoted 16 lines
Quoted 6 lines

Index: b/fs/compat_ioctl.c
===================================================================

fs/compat_ioctl.c +0 -0
@@ -63,7 +63,9 @@
Quoted 6 lines

?#include <linux/wireless.h>
?#include <linux/atalk.h>
?#include <linux/blktrace_api.h>
+#ifdef CONFIG_BLOCK
?#include <linux/loop.h>
+#endif

Adding #ifdef around an #include is considered bad style. Better just make loop.h compile without any conditionals. Does the below patch work for you?

That patch looks good, but even better would be adding a compat_ioctl handler to the loop driver. IIRC you even have an old patch for that :)

#4 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines

Adding #ifdef around an #include is considered bad style. Better just make loop.h compile without any conditionals. Does the below patch work for you?

That patch looks good, but even better would be adding a compat_ioctl handler to the loop driver.  IIRC you even have an old patch for that

No, that doesn't fly in this case. The loop driver actually has a compat_ioctl method, but the problem is that some tools try to call this ioctl on devices other than loop.

We could of course add a fallback handler to compat_blkdev_ioctl(), but I'm not convinced that this is better than the IGNORE_IOCTL helper, unless we eventually move all of fs/compat_ioctl.c into drivers.

	Arnd <><
#5 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · On Sat, 21 Jul 2007 01:08:57 +0200 Arnd Bergmann <[email protected]> wrote:
Quoted 8 lines · Sebastian Siewior

Got with randconfig
include/linux/loop.h:66: error: expected specifier-qualifier-list before 'request_queue_t'
make[1]: *** [fs/compat_ioctl.o] Error 1

parts of compat ioctl require CONFIG_BLOCK to be set.

Quoted 16 lines
Quoted 6 lines

Index: b/fs/compat_ioctl.c
===================================================================

fs/compat_ioctl.c +0 -0
@@ -63,7 +63,9 @@
Quoted 6 lines

__#include <linux/wireless.h>
__#include <linux/atalk.h>
__#include <linux/blktrace_api.h>
+#ifdef CONFIG_BLOCK
__#include <linux/loop.h>
+#endif

Adding #ifdef around an #include is considered bad style. Better just make loop.h compile without any conditionals. Does the below patch work for you?

This is the classic why-typedefs-are-bad. AFAIK there is no way of fixing this build error apart from adding otherwise-unneeded nested inclusions (very bad), or:

include/linux/loop.h struct loop_device { · line 69

Quoted 13 lines
	Arnd <><
include/linux/loop.h +1 -1
@@ -63,7 +63,7 @@ struct loop_device {
 	struct task_struct	*lo_thread;
 	wait_queue_head_t	lo_event;
 
-	request_queue_t		*lo_queue;
+	struct request_queue	*lo_queue;
 	struct gendisk		*lo_disk;
 	struct list_head	lo_list;
 };

Good start. Now can we do the rest of the kernel? ;)

#6 lore raw
Quoted 41 lines · Andrew Morton
Quoted 9 lines · On Sat, 21 Jul 2007 01:08:57 +0200 Arnd Bergmann <[email protected]> wrote:
Quoted 8 lines · Sebastian Siewior

Got with randconfig
include/linux/loop.h:66: error: expected specifier-qualifier-list before 'request_queue_t'
make[1]: *** [fs/compat_ioctl.o] Error 1

parts of compat ioctl require CONFIG_BLOCK to be set.

Quoted 16 lines
Quoted 6 lines

Index: b/fs/compat_ioctl.c
===================================================================

fs/compat_ioctl.c +0 -0
@@ -63,7 +63,9 @@
Quoted 6 lines

__#include <linux/wireless.h>
__#include <linux/atalk.h>
__#include <linux/blktrace_api.h>
+#ifdef CONFIG_BLOCK
__#include <linux/loop.h>
+#endif

Adding #ifdef around an #include is considered bad style. Better just make loop.h compile without any conditionals. Does the below patch work for you?

This is the classic why-typedefs-are-bad. AFAIK there is no way of fixing this build error apart from adding otherwise-unneeded nested inclusions (very bad), or:

Quoted 8 lines
	Arnd <><
include/linux/loop.h +0 -0
@@ -63,7 +63,7 @@ struct loop_device {
 	struct task_struct	*lo_thread;
 	wait_queue_head_t	lo_event;
 
Quoted 7 lines

include/linux/loop.h struct loop_device { · line 69

Quoted 5 lines
include/linux/loop.h +1 -1
-	request_queue_t		*lo_queue;
+	struct request_queue	*lo_queue;
 	struct gendisk		*lo_disk;
 	struct list_head	lo_list;
 };

Good start. Now can we do the rest of the kernel? ;)

Yep indeed, it's been my plan to kill that ugly typedef for some time...

Signature · 1 line
Jens Axboe