[Ocfs2-commits] mfasheh commits r1519 - branches/dlm-changes/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Sep 29 19:33:55 CDT 2004


Author: mfasheh
Date: 2004-09-29 19:33:54 -0500 (Wed, 29 Sep 2004)
New Revision: 1519

Modified:
   branches/dlm-changes/src/alloc.c
Log:
* add some asserts which should help us find coding errors more
  quickly.



Modified: branches/dlm-changes/src/alloc.c
===================================================================
--- branches/dlm-changes/src/alloc.c	2004-09-30 00:28:37 UTC (rev 1518)
+++ branches/dlm-changes/src/alloc.c	2004-09-30 00:33:54 UTC (rev 1519)
@@ -718,6 +718,8 @@
 		((ocfs2_extent_block *) eb_bhs[0]->b_data)->h_blkno;
 	el1->l_next_free_rec++;
 
+	OCFS_ASSERT(el1->l_next_free_rec <= el1->l_count);
+
 	/* Fill in all the headers and the leaf */
 	for (i = 0; i < depth; i++) {
 		ocfs2_extent_block *eb, *tmpeb;
@@ -1001,6 +1003,8 @@
 				new_clusters;
 			ebl->l_next_free_rec = fel->l_count + 1;
 
+			OCFS_ASSERT(ebl->l_next_free_rec <= ebl->l_count);
+
 			eb2->h_parent_blk = parent_blk;
 
 			parent_blk = last_eb_blkno = eb2->h_blkno;
@@ -1035,6 +1039,7 @@
 	ebl->l_recs[i].e_clusters = new_clusters;
 	ebl->l_recs[i].e_blkno = blkno;
 	ebl->l_next_free_rec = i + 1;
+	OCFS_ASSERT(ebl->l_next_free_rec <= ebl->l_count);
 
 	eb1->h_parent_blk = parent_blk;
 	eb1->h_next_leaf_blk = 0;
@@ -1280,6 +1285,7 @@
 		el1->l_recs[k].e_clusters = new_clusters;
 		el1->l_recs[k].e_blkno = blkno;
 		el1->l_next_free_rec++;
+		OCFS_ASSERT(el1->l_next_free_rec <= el1->l_count);
 		UpdateParent = 1;
 	} else {
 		/* Read the last extent and keep traversing



More information about the Ocfs2-commits mailing list