[DRBD-cvs] r1787 - trunk/drbd

www-data www-data at garcon.linbit.com
Sat Apr 23 19:52:45 CEST 2005


Author: phil
Date: 2005-04-23 19:52:45 +0200 (Sat, 23 Apr 2005)
New Revision: 1787

Modified:
   trunk/drbd/drbd_fs.c
Log:
The logic in some lines in do_determin_dev_size() still
assumed that size is in KB while it is now in secotrs.
BTW, was triggered by Lars' BM_PARANOIA_CHECK. 


Modified: trunk/drbd/drbd_fs.c
===================================================================
--- trunk/drbd/drbd_fs.c	2005-04-22 09:29:54 UTC (rev 1786)
+++ trunk/drbd/drbd_fs.c	2005-04-23 17:52:45 UTC (rev 1787)
@@ -131,12 +131,11 @@
 	}
 
 	if(u_size) {
-		/* FIXME size now in sectors, user still provides KB */
-		if(u_size > size) {
+		if(u_size<<1 > size) {
 			ERR("Requested disk size is too big (%lu > %lu)\n",
-			    (unsigned long)u_size, (unsigned long)size);
+			    (unsigned long)u_size, (unsigned long)size>>1);
 		} else {
-			size = u_size;
+			size = u_size<<1;
 		}
 	}
 
@@ -157,10 +156,10 @@
 			}
 		}
 		// racy, see comments above.
-		drbd_set_my_capacity(mdev,size<<1);
+		drbd_set_my_capacity(mdev,size);
 		mdev->la_size = size;
-		INFO("size = %s (%lu KB)\n",ppsize(ppb,size),
-		     (unsigned long)size);
+		INFO("size = %s (%lu KB)\n",ppsize(ppb,size>>1),
+		     (unsigned long)size>>1);
 	}
 
 	return rv;



More information about the drbd-cvs mailing list