[Ocfs2-tools-commits] taoma commits r1335 - branches/sparse-files/libocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Mar 27 23:10:16 PDT 2007


Author: taoma
Date: 2007-03-27 23:10:14 -0700 (Tue, 27 Mar 2007)
New Revision: 1335

Modified:
   branches/sparse-files/libocfs2/extent_map.c
Log:
Check in the 3 bugs of extent map joel found in code review.

Modified: branches/sparse-files/libocfs2/extent_map.c
===================================================================
--- branches/sparse-files/libocfs2/extent_map.c	2007-03-27 21:00:19 UTC (rev 1334)
+++ branches/sparse-files/libocfs2/extent_map.c	2007-03-28 06:10:14 UTC (rev 1335)
@@ -522,7 +522,7 @@
 
 	i = ocfs2_search_for_hole_index(el, v_cluster);
 
-	if (i == le16_to_cpu(el->l_next_free_rec) && eb_buf) {
+	if (i == el->l_next_free_rec && eb_buf) {
 		eb = (struct ocfs2_extent_block *)eb_buf;
 
 		/*
@@ -545,6 +545,13 @@
 		el = &next_eb->h_list;
 
 		i = ocfs2_search_for_hole_index(el, v_cluster);
+		if (i > 0) {
+			if ((i > 1) || ocfs2_rec_clusters(el->l_tree_depth,
+							  &el->l_recs[0])) {
+				ret = OCFS2_ET_CORRUPT_EXTENT_BLOCK;
+			goto out;
+			}
+		}
 	}
 
 no_more_extents:
@@ -554,7 +561,7 @@
 		 * return the maximum number of clusters we could
 		 * possibly allocate.
 		 */
-		*num_clusters = UINT_MAX - v_cluster;
+		*num_clusters = UINT32_MAX - v_cluster;
 	} else
 		*num_clusters = el->l_recs[i].e_cpos - v_cluster;
 




More information about the Ocfs2-tools-commits mailing list