[DRBD-cvs] r1885 - branches/drbd-0.7/drbd

www-data www-data at linbit.com
Mon Jul 18 12:19:47 CEST 2005


Author: lars
Date: 2005-07-18 12:19:46 +0200 (Mon, 18 Jul 2005)
New Revision: 1885

Modified:
   branches/drbd-0.7/drbd/drbd_fs.c
Log:

while resizing the bitmap, we have to write everything, if the meta data has moved.
we have to shrink the al, if we are smaller now,
and we have to write at least the bitmap, if we are bigger now.

just do all this if (la_size_changed || md_moved)



Modified: branches/drbd-0.7/drbd/drbd_fs.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_fs.c	2005-07-18 09:55:12 UTC (rev 1884)
+++ branches/drbd-0.7/drbd/drbd_fs.c	2005-07-18 10:19:46 UTC (rev 1885)
@@ -83,19 +83,16 @@
 	rv = do_determin_dev_size(mdev);
 
 	la_size_changed = (la_size != mdev->la_size);
-	md_moved = (pmdss != drbd_md_ss(mdev) /* && mdev->md_index == -1 */);
+	md_moved = pmdss != drbd_md_ss(mdev) /* && mdev->md_index == -1 */;
 
 	if ( md_moved ) {
 		WARN("Moving meta-data.\n");
 		D_ASSERT(mdev->md_index == -1);
 	}
 
-	if( mdev->la_size < la_size || md_moved) {
+	if ( la_size_changed || md_moved ) {
 		drbd_al_shrink(mdev); // All extents inactive.
 		drbd_bm_write(mdev);  // write bitmap
-	}
-
-	if ( la_size_changed || md_moved ) {
 		// Write mdev->la_size to [possibly new position on] disk.
 		drbd_md_write(mdev);
 	}



More information about the drbd-cvs mailing list