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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Sep 29 19:28:39 CDT 2004


Author: mfasheh
Date: 2004-09-29 19:28:37 -0500 (Wed, 29 Sep 2004)
New Revision: 1518

Modified:
   branches/dlm-changes/src/alloc.c
Log:
* in ocfs_reserve_bits, we weren't failing back to the main bitmap properly 
if the local didn't work.

* silence a *ton* of error output we get when the disk is full.

* turn a LOG_ERROR in the discontiguous allocation case into a LOG_TRACE.   



Modified: branches/dlm-changes/src/alloc.c
===================================================================
--- branches/dlm-changes/src/alloc.c	2004-09-30 00:19:18 UTC (rev 1517)
+++ branches/dlm-changes/src/alloc.c	2004-09-30 00:28:37 UTC (rev 1518)
@@ -2896,7 +2896,11 @@
 						     num_bits);
 	}
 	if (status < 0) {
-		LOG_ERROR_STATUS(status);
+		/* If you're not asking for contiguous blocks, then
+		 * the reserve function should've given you enough,
+		 * and ENOSPC this is a real error. */
+		if ((status != -ENOSPC) || (min_bits == 1))
+			LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -2949,15 +2953,14 @@
 	}
 
 	if (best_fit_bits < min_bits) {
-		LOG_ERROR_ARGS ("Cannot allocate %u contiguous clusters for "
+		LOG_TRACE_ARGS ("Cannot allocate %u contiguous clusters for "
 				"system file\n", min_bits);
 		status = -ENOSPC;
 		goto bail;
 	}
 
-#warning this is not an error
 	if (best_fit_bits != bits_wanted)
-		LOG_ERROR_ARGS("discontiguous allocation done: wanted = %u, "
+		LOG_TRACE_ARGS("discontiguous allocation done: wanted = %u, "
 			       "best_fit = %u, bit_off = %u!\n", 
 			       bits_wanted, best_fit_bits, *bit_off);
 
@@ -3076,7 +3079,7 @@
 						 handle, 
 						 bits_wanted, 
 						 *ac);
-		if ((status < 0) && (status != -ENOMEM)) {
+		if ((status < 0) && (status != -ENOSPC)) {
 			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
@@ -3238,7 +3241,8 @@
 			ocfs_local_alloc_full_window_change(osb, 
 							    local_alloc_inode);
 		if (status < 0) {
-			LOG_ERROR_STATUS(status);
+			if (status != -ENOSPC)
+				LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 	}
@@ -3333,7 +3337,7 @@
 				       NULL);
 	if (status < 0) {
 		osb->cluster_bitmap.failed++;
-		LOG_ERROR_ARGS("Cannot allocate %u contiguous clusters"
+		LOG_TRACE_ARGS("Cannot allocate %u contiguous clusters "
 			       "for system file\n", num_clusters);
 		status = -ENOSPC;
 		goto leave;
@@ -3730,7 +3734,8 @@
 							lock_bh, 
 							bm_inode);
 	if (status < 0) {
-		LOG_ERROR_STATUS(status);
+		if (status != -ENOSPC)
+			LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	atomic_inc(&osb->alloc_stats.bitmap_data);
@@ -3893,7 +3898,8 @@
 
 	status = ocfs_alloc_new_window(osb, main_bm_bh, main_bm_inode, handle);
 	if (status < 0) {
-		LOG_ERROR_STATUS(status);
+		if (status != -ENOSPC)
+			LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 



More information about the Ocfs2-commits mailing list