[DRBD-cvs] drbd by phil; Another 64bit micro fix...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Mon, 5 Jul 2004 15:55:00 +0200 (CEST)


DRBD CVS committal

Author  : phil
Module  : drbd

Dir     : drbd/drbd


Modified Files:
      Tag: rel-0_7-branch
	drbd_bitmap.c drbd_main.c 


Log Message:
Another 64bit micro fix...

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_bitmap.c,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -3 -r1.1.2.6 -r1.1.2.7
--- drbd_bitmap.c	25 Jun 2004 09:44:20 -0000	1.1.2.6
+++ drbd_bitmap.c	5 Jul 2004 13:54:54 -0000	1.1.2.7
@@ -242,7 +242,13 @@
 	} else {
 		bits  = ALIGN(capacity,BM_SECTORS_PER_BIT)
 		      >> (BM_BLOCK_SIZE_B-9);
-		words = ALIGN(bits,BITS_PER_LONG) >> LN2_BPL;
+
+		/* if we would use 
+		   words = ALIGN(bits,BITS_PER_LONG) >> LN2_BPL;
+		   a 32bit host could present the wrong number of words
+		   to a 64bit host.
+		*/
+		words = ALIGN(bits,64) >> 6;
 
 		D_ASSERT(bits < ((MD_RESERVED_SIZE<<1)-MD_BM_OFFSET)<<12 );
 
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_main.c,v
retrieving revision 1.73.2.197
retrieving revision 1.73.2.198
diff -u -3 -r1.73.2.197 -r1.73.2.198
--- drbd_main.c	5 Jul 2004 13:32:58 -0000	1.73.2.197
+++ drbd_main.c	5 Jul 2004 13:54:54 -0000	1.73.2.198
@@ -55,18 +55,6 @@
 #include "drbd_int.h"
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-# warning "----------------------------------------"
-# warning "  NOTE 2.4 compatibility is untested.   "
-# warning "     it compiles, it may even work.     "
-# warning " but it may also oops at you. and if it "
-# warning " does oops at you right away, let us    "
-# warning " know, but don't expect a fix too soon, "
-# warning " as primary target is 2.6 now.          "
-# warning " If it works for you, let us know, too. "
-# warning "----------------------------------------"
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 # if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64)
 extern int register_ioctl32_conversion(unsigned int cmd,
 				       int (*handler)(unsigned int,