[DRBD-cvs] r1619 - in branches/drbd-0.7: drbd user

svn at svn.drbd.org svn at svn.drbd.org
Fri Oct 29 04:21:04 CEST 2004


Author: lars
Date: 2004-10-29 04:21:01 +0200 (Fri, 29 Oct 2004)
New Revision: 1619

Modified:
   branches/drbd-0.7/drbd/drbd_sizeof_sanity_check.c
   branches/drbd-0.7/user/drbd_limits.h
Log:
updated sizeof() sanity check with the new size values

Modified: branches/drbd-0.7/drbd/drbd_sizeof_sanity_check.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_sizeof_sanity_check.c	2004-10-28 20:08:49 UTC (rev 1618)
+++ branches/drbd-0.7/drbd/drbd_sizeof_sanity_check.c	2004-10-29 02:21:01 UTC (rev 1619)
@@ -6,21 +6,23 @@
 	__attribute__ ((format (printf, 1, 2)));
 
 #define SZO(type,size) \
-	if (sizeof(type) != size) { \
-		printk("<3>sizeof(" #type ") != %d; " \
-			"ioctls won't work, aborting\n", size); \
-		return -1; \
+	s = sizeof(type); \
+	if (s != size) { \
+		printk("<3>sizeof(" #type "): %d != %d; " \
+			"ioctls won't work, aborting\n", s, size); \
+		err = -1; \
 	}
 
 int sizeof_drbd_structs_sanity_check(void)
 {
+	int err = 0, s = 0;
 	SZO(struct disk_config,		 24)
-	SZO(struct net_config,		300)
-	SZO(struct syncer_config,	 20)
-	SZO(struct ioctl_disk_config,	 28)
-	SZO(struct ioctl_net_config,	304)
-	SZO(struct ioctl_syncer_config,	 24)
-	SZO(struct ioctl_wait,		 12)
-	SZO(struct ioctl_get_config,	428)
-	return 0;
+	SZO(struct net_config,		304)
+	SZO(struct syncer_config,	 24)
+	SZO(struct ioctl_disk_config,	 32)
+	SZO(struct ioctl_net_config,	312)
+	SZO(struct ioctl_syncer_config,	 32)
+	SZO(struct ioctl_wait,		 16)
+	SZO(struct ioctl_get_config,	440)
+	return err;
 }

Modified: branches/drbd-0.7/user/drbd_limits.h
===================================================================
--- branches/drbd-0.7/user/drbd_limits.h	2004-10-28 20:08:49 UTC (rev 1618)
+++ branches/drbd-0.7/user/drbd_limits.h	2004-10-29 02:21:01 UTC (rev 1619)
@@ -13,7 +13,7 @@
 #ifndef DRBD_LIMITS_H
 #define DRBD_LIMITS_H 1
 
-#define DEBUG_RANGE_CHECK 1
+#define DEBUG_RANGE_CHECK 0
 
 #define RANGE(what,min,max) \
 const unsigned long long DRBD_ ## what ## _MIN = (min); \



More information about the drbd-cvs mailing list