[DRBD-user] [patch] fix ioctl32 wrapper for 0.8pre2

Guido Guenther agx at sigxcpu.org
Wed Apr 12 15:39:26 CEST 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Hi,
the patch below is needed to get the module loaded on recent kernels.
CONFIG_COMPAT is always defined so we'd end up calling
(un)register_ioctl32_conversion even when with kernels newer than
2.6.10. This doesn't work since these functions don't exist anymore.
I basically reverted to the code 0.7 uses. Please apply.
Cheers,
 -- Guido

P.S.: besides from that I'm seeing pretty much the same oops other
reported with 2.6.16.

--- drbd/drbd_main.c.orig	2006-04-12 14:34:03.000000000 +0200
+++ drbd/drbd_main.c	2006-04-12 14:33:53.000000000 +0200
@@ -2399,7 +2400,8 @@
 # error "Currently drbd depends on the proc file system (CONFIG_PROC_FS)"
 #endif
 
-#if defined(CONFIG_COMPAT)
+#ifndef HAVE_COMPAT_IOCTL_MEMBER
+#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64)
 	// tell the kernel that we think our ioctls are 64bit clean
 	lock_kernel();
 	register_ioctl32_conversion(DRBD_IOCTL_GET_VERSION,NULL);
@@ -2417,6 +2419,7 @@
 	register_ioctl32_conversion(DRBD_IOCTL_UNCONFIG_DISK,NULL);
 	unlock_kernel();
 #endif
+#endif
 
 	printk(KERN_INFO DEVICE_NAME ": initialised. "
 	       "Version: " REL_VERSION " (api:%d/proto:%d)\n",
@@ -2201,7 +2201,8 @@
 		drbd_destroy_mempools();
 	}
 
-#if defined(CONFIG_COMPAT)
+#ifndef HAVE_COMPAT_IOCTL_MEMBER
+#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64)
 	lock_kernel();
 	unregister_ioctl32_conversion(DRBD_IOCTL_GET_VERSION);
 	unregister_ioctl32_conversion(DRBD_IOCTL_SET_STATE);
@@ -2218,6 +2219,7 @@
 	unregister_ioctl32_conversion(DRBD_IOCTL_UNCONFIG_DISK);
 	unlock_kernel();
 #endif
+#endif
 
 	kfree(drbd_conf);
 



More information about the drbd-user mailing list