[Ocfs2-commits] mfasheh commits r2148 - in trunk/fs/ocfs2: . cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Apr 18 23:57:02 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-18 23:57:00 -0500 (Mon, 18 Apr 2005)
New Revision: 2148

Modified:
   trunk/fs/ocfs2/aio.c
   trunk/fs/ocfs2/alloc.c
   trunk/fs/ocfs2/cluster/tcp.c
   trunk/fs/ocfs2/dir.c
   trunk/fs/ocfs2/dlm/dlmdomain.c
   trunk/fs/ocfs2/dlm/dlmmaster.c
   trunk/fs/ocfs2/dlm/userdlm.c
   trunk/fs/ocfs2/dlmglue.c
   trunk/fs/ocfs2/file.c
   trunk/fs/ocfs2/inode.c
   trunk/fs/ocfs2/journal.c
   trunk/fs/ocfs2/localalloc.c
   trunk/fs/ocfs2/mmap.c
   trunk/fs/ocfs2/namei.c
   trunk/fs/ocfs2/ocfs_log.h
   trunk/fs/ocfs2/slot_map.c
   trunk/fs/ocfs2/suballoc.c
   trunk/fs/ocfs2/super.c
   trunk/fs/ocfs2/vote.c
Log:
* Return -ERESTARTSYS instead of -EINTR. This allows the signal processing  
  code to handle things like SA_RESTART properly for us.

* Fix up LOG_ERROR_STATUS to just ignore -EINTR and -ERESTARTSYS, rather
  than always having to manually filter those.

* Check for -ERESTARTSYS return code from wait_event_interruptible, not
  EINTR.

Signed-off-by: manish



Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/aio.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -265,8 +265,7 @@
 	okp->kp_info.wl_unlock_ctxt = 1; /* re-use the write info path */
 	ret = ocfs2_lock_buffer_inodes(&okp->kp_ctxt, NULL);
 	if (ret < 0) {
-		if (ret != -EINTR)
-			LOG_ERROR_STATUS(ret);
+		LOG_ERROR_STATUS(ret);
 		goto out;
 	}
 

Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/alloc.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -1364,8 +1364,7 @@
 					&ext_alloc_bh,
 					1);
 		if (status < 0) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS (status);
 			goto bail;
 		}
 	}
@@ -1380,8 +1379,7 @@
 	ocfs_handle_add_inode(handle, data_alloc_inode);
 	status = ocfs2_meta_lock(data_alloc_inode, handle, &data_alloc_bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS (status);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -700,7 +700,7 @@
 	if (ret != total) {
 		netprintk("sendmsg returned %d instead of %zu\n", ret, total);
 		if (ret >= 0)
-			ret = -EINTR; /* should be smarter, I bet */
+			ret = -EPIPE; /* should be smarter, I bet */
 		goto out;
 	}
 

Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/dir.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -94,8 +94,7 @@
 
 	error = ocfs2_meta_lock(inode, NULL, NULL, 0);
 	if (error < 0) {
-		if (error != -EINTR)
-			LOG_ERROR_STATUS (error);
+		LOG_ERROR_STATUS(error);
 		/* we haven't got any yet, so propagate the error. */
 		stored = error;
 		goto bail;
@@ -229,8 +228,7 @@
 		status = ocfs2_meta_lock(inode, NULL, NULL, 0);
 		if (status < 0) {
 			/* Volume should be disabled in this case */
-			if (status != -EINTR)
-				LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto leave;
 		}
 		lock_acq = 1;
@@ -398,7 +396,8 @@
 
 	handle = ocfs_alloc_handle(osb);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -417,7 +416,7 @@
 			status = ocfs_reserve_new_metadata(osb, handle,
 							   fe, &meta_ac);
 			if (status < 0) {
-				LOG_ERROR_STATUS (status);
+				LOG_ERROR_STATUS(status);
 				goto bail;
 			}
 		}
@@ -436,7 +435,8 @@
 
 	handle = ocfs_start_trans(osb, handle, credits);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdomain.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/dlm/dlmdomain.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -1089,7 +1089,7 @@
 			schedule();
 
 			if (signal_pending(current)) {
-				status = -EINTR;
+				status = -ERESTARTSYS;
 				goto bail;
 			}
 		}

Modified: trunk/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmaster.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/dlm/dlmmaster.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -776,7 +776,7 @@
 		}
 		/* unless we are aborting, need to recheck and 
 		 * maybe sleep again */
-		if (ret != -EINTR)
+		if (ret != -ERESTARTSYS)
 			ret = -EAGAIN;
 		goto leave;
 	}
@@ -1563,7 +1563,7 @@
 
 			dlmprintk0("timed out during migration\n");
 		}
-		if (ret == -EINTR) {
+		if (ret == -ERESTARTSYS) {
 			/* migration failed, detach and clean up mle */
 			dlm_mle_detach_hb_events(dlm, mle);
 			dlm_put_mle(mle);

Modified: trunk/fs/ocfs2/dlm/userdlm.c
===================================================================
--- trunk/fs/ocfs2/dlm/userdlm.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/dlm/userdlm.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -395,7 +395,7 @@
 
 again:
 	if (signal_pending(current)) {
-		status = -EINTR;
+		status = -ERESTARTSYS;
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/dlmglue.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -946,7 +946,7 @@
 
 again:
 	if (catch_signals && signal_pending(current)) {
-		ret = -EINTR;
+		ret = -ERESTARTSYS;
 		goto out;
 	}
 
@@ -1132,7 +1132,7 @@
 
 	status = ocfs2_cluster_lock(OCFS2_SB(inode->i_sb), lockres, level, 0,
 				    NULL, 0);
-	if (status < 0 && status != -EINTR)
+	if (status < 0)
 		LOG_ERROR_STATUS(status);
 
 	LOG_EXIT_STATUS(status);
@@ -1437,14 +1437,17 @@
 	dprintk("inode %llu, take %s META lock\n", OCFS_I(inode)->ip_blkno,
 		ex ? "EXMODE" : "PRMODE");
 
+	status = 0;
+
 	if (!(flags & OCFS2_META_LOCK_RECOVERY))
-		wait_event_interruptible(osb->recovery_event,
-					 ocfs_node_map_is_empty(osb,
-								&osb->recovery_map));
+		status = wait_event_interruptible(osb->recovery_event,
+					       ocfs_node_map_is_empty(osb,
+								      &osb->recovery_map));
+	if (status < 0) {
+		LOG_ERROR_STATUS(status);
+		return status;
+	}
 
-	if (signal_pending(current))
-		return -EINTR;
-
 	lockres = &OCFS_I(inode)->ip_meta_lockres;
 	level = ex ? LKM_EXMODE : LKM_PRMODE;
 	dlm_flags = 0;
@@ -1454,7 +1457,7 @@
 	status = ocfs2_cluster_lock(osb, lockres, level, dlm_flags, cb,
 				    cb_data);
 	if (status < 0) {
-		if (status != -EINTR && status != -EAGAIN)
+		if (status != -EAGAIN)
 			LOG_ERROR_STATUS(status);
 		goto bail;
 	}
@@ -1559,8 +1562,7 @@
 
 	status = ocfs2_cluster_lock(osb, lockres, level, 0, NULL, 0);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1570,8 +1572,7 @@
 	 * everything is up to the caller :) */
 	status = ocfs2_should_refresh_lock_res(lockres);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	if (status) {

Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/file.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -349,8 +349,7 @@
 
 	ret = ocfs2_lock_buffer_inodes(&ctxt, NULL);
 	if (ret < 0) {
-		if (ret != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail_unlock;
 	}
 
@@ -463,7 +462,8 @@
 
 	handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -535,7 +535,8 @@
 		handle = ocfs_start_trans(osb, NULL, 
 					  OCFS_INODE_UPDATE_CREDITS);
 		if (handle == NULL) {
-			LOG_ERROR_STATUS (status = -ENOMEM);
+			status = -ENOMEM;
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 
@@ -552,8 +553,7 @@
 	/* This forces other nodes to sync and drop their pages */
 	status = ocfs2_data_lock(inode, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	ocfs2_data_unlock(inode, 1);
@@ -786,7 +786,8 @@
 restart_all:
 	handle = ocfs_alloc_handle(osb);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -866,7 +867,8 @@
 	credits = ocfs_calc_extend_credits(osb->sb, fe, clusters_to_add);
 	handle = ocfs_start_trans(osb, handle, credits);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -938,7 +940,8 @@
 			if (status < 0) {
 				/* handle still has to be committed at
 				 * this point. */
-				LOG_ERROR_STATUS(status = -ENOMEM);
+				status = -ENOMEM;
+				LOG_ERROR_STATUS(status);
 				goto leave;
 			}
 			goto restarted_transaction;
@@ -1044,8 +1047,7 @@
 
 	status = ocfs2_meta_lock(inode, NULL, &bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	unlock = 1;
@@ -1060,14 +1062,17 @@
 			status = ocfs_extend_file(osb, inode, newsize,
 						  &bytes_added);
 		if (status < 0 && (!bytes_added)) {
-			if (status != -EINTR && status != -ENOSPC)
+			if (status != -ENOSPC)
 				LOG_ERROR_STATUS(status);
 			status = -ENOSPC;
 			goto bail;
 		}
 
 		/* partial extend, we continue with what we've got. */
-		if (status < 0 && status != -ENOSPC && status != -EINTR)
+		if (status < 0
+		    && status != -ENOSPC
+		    && status != -EINTR
+		    && status != -ERESTARTSYS)
 			LOG_ERROR_ARGS("status return of %d extending inode "
 				       "%llu\n", status,
 				       OCFS_I(inode)->ip_blkno);

Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/inode.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -554,7 +554,8 @@
 
 	handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -646,8 +647,7 @@
 	status = ocfs2_meta_lock(inode, NULL, &fe_bh, 1);
 	atomic_dec(&inode->i_count);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -849,7 +849,7 @@
 	ocfs2_extent_map_drop(inode, 0);
 
 	status = ocfs2_drop_inode_locks(inode);
-	if (status < 0 && status != -EINTR)
+	if (status < 0)
 		LOG_ERROR_STATUS(status);
 
 	ocfs2_lock_res_free(&OCFS_I(inode)->ip_meta_lockres);
@@ -961,8 +961,7 @@
 
 	status = ocfs2_meta_lock(inode, NULL, NULL, 0);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	ocfs2_meta_unlock(inode, 0);

Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/journal.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -640,7 +640,7 @@
 
 	status = ocfs2_meta_lock(inode, NULL, &bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
+		if (status != -ERESTARTSYS)
 			LOG_ERROR_STR("Could not get lock on journal!");
 		goto done;
 	}
@@ -754,7 +754,8 @@
 	inode = journal->j_inode;
 
 	if (journal->j_state != OCFS_JOURNAL_LOADED) {
-		LOG_ERROR_STATUS(status = -EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto done;
 	}
 
@@ -1199,7 +1200,7 @@
 	if (status < 0) {
 		LOG_TRACE_ARGS("status returned from ocfs2_meta_lock=%d\n", 
 			       status);
-		if (status != -EINTR)
+		if (status != -ERESTARTSYS)
 			LOG_ERROR_STR("Could not lock journal!");
 		goto done;
 	}
@@ -1383,7 +1384,7 @@
 	flags = OCFS2_META_LOCK_RECOVERY|OCFS2_META_LOCK_NOQUEUE;
 	status = ocfs2_meta_lock_flags(inode, NULL, NULL, 1, flags);
 	if (status < 0) {
-		if (status != -EAGAIN && status != -EINTR)
+		if (status != -EAGAIN)
 			LOG_ERROR_STATUS(status);
 		goto bail;
 	}
@@ -1427,8 +1428,7 @@
 			 * setting / checking the recovery bits. */
 			ocfs_recovery_thread(osb, node_num);
 		} else if ((status < 0) && (status != -EAGAIN)) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS(status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 

Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/localalloc.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -150,7 +150,8 @@
 	inode = ocfs_get_system_file_inode(osb, LOCAL_ALLOC_SYSTEM_INODE, 
 					   osb->slot_num);
 	if (!inode) {
-		LOG_ERROR_STATUS(status=-EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	status = ocfs_read_block(osb, OCFS_I(inode)->ip_blkno, &alloc_bh, 0, 
@@ -258,7 +259,7 @@
 	handle = ocfs_alloc_handle(osb);
 	if (!handle) {
 		status = -ENOMEM;
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -267,15 +268,14 @@
 						   -1);
 	if (!main_bm_inode) {
 		status = -EINVAL;
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
 	ocfs_handle_add_inode(handle, main_bm_inode);
 	status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -364,7 +364,8 @@
 					   LOCAL_ALLOC_SYSTEM_INODE, 
 					   slot_num);
 	if (!inode) {
-		LOG_ERROR_STATUS(status=-EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -440,14 +441,14 @@
 	ocfs_handle_add_inode(handle, main_bm_inode);
 	status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS (status);
 		goto bail;
 	}
 
 	handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
 	if (!handle) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -938,8 +939,7 @@
 						     &main_bm_inode,
 						     &main_bm_bh);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/mmap.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -83,15 +83,13 @@
 		 * worry about read locking here. */
 		status = ocfs2_meta_lock(inode, NULL, NULL, 0);
 		if (status < 0) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS(status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 
 		status = ocfs2_data_lock(inode, 0);
 		if (status < 0) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS(status);
+			LOG_ERROR_STATUS(status);
 			ocfs2_meta_unlock(inode, 0);
 			goto bail;
 		}
@@ -358,8 +356,7 @@
 						ctxt->b_cb,
 						ctxt->b_cb_data);
 			if (status < 0) {
-				if (status != -EINTR)
-					LOG_ERROR_STATUS(status);
+				LOG_ERROR_STATUS(status);
 				goto bail;
 			}
 			binode->ba_meta_locked = 1;
@@ -375,8 +372,7 @@
 				ocfs2_meta_unlock(inode,
 						  binode->ba_lock_meta_level);
 
-				if (status != -EINTR)
-					LOG_ERROR_STATUS(status);
+				LOG_ERROR_STATUS(status);
 				goto bail;
 			}
 		}
@@ -466,8 +462,7 @@
 		info->wl_unlock_ctxt = 1;
 		ret = ocfs2_lock_buffer_inodes(ctxt, inode);
 		if (ret < 0) {
-			if (ret != -EINTR)
-				LOG_ERROR_STATUS(ret);
+			LOG_ERROR_STATUS(ret);
 			goto bail;
 		}
 		info->wl_have_before = 1;
@@ -484,8 +479,7 @@
 	if (!info->wl_have_target_meta) {
 		status = ocfs2_meta_lock(inode, NULL, NULL, level);
 		if (status < 0) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS(status);
+			LOG_ERROR_STATUS(status);
 			ret = status;
 			goto bail;
 		}
@@ -556,8 +550,10 @@
 		status = ocfs_extend_file(osb, inode, info->wl_newsize,
 					  &bytes_added);
 		if (status < 0 && (!bytes_added)) {
-			if (status != -EINTR && status != -ENOSPC) {
-				LOG_ERROR_STATUS (status);
+			if (status != -ERESTARTSYS
+			    && status != -EINTR
+			    && status != -ENOSPC) {
+				LOG_ERROR_STATUS(status);
 				LOG_ERROR_ARGS("Failed to extend inode %llu "
 					       "from %llu to %llu",
 						OCFS_I(inode)->ip_blkno,
@@ -577,7 +573,10 @@
 		info->wl_newsize = i_size_read(inode) + bytes_added;
 		count = info->wl_newsize - saved_ppos;
 
-		if (status < 0 && status != -ENOSPC && status != -EINTR)
+		if (status < 0
+		    && status != -ENOSPC
+		    && status != -EINTR
+		    && status != -ERESTARTSYS)
 			LOG_ERROR_ARGS("status return of %d extending inode "
 				       "%llu\n", status,
 				       OCFS_I(inode)->ip_blkno);
@@ -591,8 +590,7 @@
 	if (!info->wl_do_direct_io && !info->wl_have_data_lock) {
 		status = ocfs2_data_lock(inode, 1);
 		if (status < 0) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS(status);
+			LOG_ERROR_STATUS(status);
 			ret = status;
 
 			info->wl_have_target_meta = 0;
@@ -610,8 +608,7 @@
 	/* This will lock everyone who's order puts them *after* our inode. */
 	ret = ocfs2_lock_buffer_inodes(ctxt, NULL);
 	if (ret < 0) {
-		if (ret != -EINTR)
-			LOG_ERROR_STATUS(ret);
+		LOG_ERROR_STATUS(ret);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/namei.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -350,20 +350,21 @@
 	}
 
 	if (ocfs_inode_init_private(inode)) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	handle = ocfs_alloc_handle(osb);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -379,7 +380,7 @@
 					     dentry->d_name.name, 
 					     dentry->d_name.len, &de_bh);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -387,7 +388,7 @@
 	status = ocfs_reserve_new_inode(osb, handle, &inode_ac);
 	if (status < 0) {
 		if (status != -ENOSPC)
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -403,7 +404,8 @@
 
 	handle = ocfs_start_trans(osb, handle, OCFS_MKNOD_CREDITS);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -412,8 +414,7 @@
 				   &new_fe_bh, parent_fe_bh, handle, 
 				   inode, inode_ac);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -460,7 +461,7 @@
 	status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
 				parent_fe_bh, de_bh);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -474,7 +475,7 @@
 
 	if (status == -ENOSPC)
 		LOG_TRACE_STR ("Disk is full");
-	else if (status < 0 && status != -EINTR)
+	else if (status < 0)
 		LOG_ERROR_STATUS(status);
 
 	if (new_fe_bh) 
@@ -529,7 +530,7 @@
 	status = ocfs_claim_new_inode(osb, handle, inode_ac, &suballoc_bit,
 				      &fe_blkno);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -545,7 +546,7 @@
 	status = ocfs_journal_access(handle, inode, *new_fe_bh,
 				     OCFS_JOURNAL_ACCESS_CREATE);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -691,8 +692,7 @@
 
 	err = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
 	if (err < 0) {
-		if (err != -EINTR)
-			LOG_ERROR_STATUS (err);
+		LOG_ERROR_STATUS(err);
 		goto bail;
 	}
 
@@ -700,14 +700,13 @@
 					     dentry->d_name.name, 
 					     dentry->d_name.len, &de_bh);
 	if (err < 0) {
-		LOG_ERROR_STATUS (err);
+		LOG_ERROR_STATUS(err);
 		goto bail;
 	}
 
 	err = ocfs2_meta_lock(inode, handle, &fe_bh, 1);
 	if (err < 0) {
-		if (err != -EINTR)
-			LOG_ERROR_STATUS (err);
+		LOG_ERROR_STATUS(err);
 		goto bail;
 	}
 
@@ -809,7 +808,8 @@
 
 	handle = ocfs_alloc_handle(osb);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -833,16 +833,14 @@
 
 	status = ocfs2_meta_lock(inode, handle, &fe_bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs2_request_unlink_vote(inode);
 	if (status < 0) {
 		/* This vote should succeed under all normal circumstances. */
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -861,21 +859,22 @@
 						 &orphan_name, 
 						 &orphan_entry_bh);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto leave;
 		}
 	}
 
 	handle = ocfs_start_trans(osb, handle, OCFS_UNLINK_CREDITS);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs_journal_access(handle, inode, fe_bh,
 				     OCFS_JOURNAL_ACCESS_WRITE);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -931,8 +930,12 @@
 	if (handle)
 		ocfs_commit_trans(handle);
 
-	if (status < 0 && status != -ENOTEMPTY && 
-	    status != -EPERM && status != -EBUSY && status != -EINTR) {
+	if (status < 0
+	    && status != -ENOTEMPTY
+	    && status != -EPERM
+	    && status != -EBUSY
+	    && status != -EINTR
+	    && status != -ERESTARTSYS) {
 		LOG_ERROR_STATUS(status);
 		retval = -EBUSY;
 	} else
@@ -1005,14 +1008,14 @@
 		/* lock id2 */
 		status = ocfs2_meta_lock(inode2, handle, bh2, 1);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 	}
 	/* lock id1 */
 	status = ocfs2_meta_lock(inode1, handle, bh1, 1);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 bail:
@@ -1075,7 +1078,8 @@
 
 	handle = ocfs_alloc_handle(osb);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1167,7 +1171,7 @@
 	if ((status < 0) && (status != -ENOENT)) {
 		/* If we cannot find the file specified we should just */
 		/* return the error... */
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	} 
 
@@ -1209,7 +1213,7 @@
 							 &orphan_name,
 							 &orphan_entry_bh);
 			if (status < 0) {
-				LOG_ERROR_STATUS (status);
+				LOG_ERROR_STATUS(status);
 				goto bail;
 			}
 		}
@@ -1220,14 +1224,15 @@
 						     new_dentry->d_name.len,
 						     &insert_entry_bh);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 	}
 
 	handle = ocfs_start_trans(osb, handle, OCFS_RENAME_CREDITS);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1241,7 +1246,7 @@
 		status = ocfs_journal_access(handle, new_inode, newfe_bh, 
 					     OCFS_JOURNAL_ACCESS_WRITE);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 
@@ -1259,7 +1264,7 @@
 		status = ocfs_journal_access(handle, new_dir, new_de_bh, 
 					     OCFS_JOURNAL_ACCESS_WRITE);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 		new_de->inode =
@@ -1279,7 +1284,7 @@
 
 		status = ocfs_journal_dirty(handle, newfe_bh);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 	} else {
@@ -1541,7 +1546,8 @@
 	}
 
 	if (ocfs_inode_init_private(inode)) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		iput(inode);
 		inode = NULL;
 		goto bail;
@@ -1551,15 +1557,15 @@
 
 	handle = ocfs_alloc_handle(osb);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
 	/* lock the parent directory */
 	status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1574,13 +1580,13 @@
 					     dentry->d_name.name, 
 					     dentry->d_name.len, &de_bh);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
 	status = ocfs_reserve_new_inode(osb, handle, &inode_ac);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1588,14 +1594,15 @@
 	if (l > ocfs2_fast_symlink_chars(sb)) {
 		status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status = -ENOMEM);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 	}
 
 	handle = ocfs_start_trans(osb, handle, credits);
 	if (handle == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1631,7 +1638,8 @@
 						handle, data_ac, NULL, NULL);
 		if (status < 0) {
 			if (status != -ENOSPC && status != -EINTR) {
-				LOG_ERROR_ARGS ("Failed to extend file to %llu", newsize);
+				LOG_ERROR_ARGS("Failed to extend file to %llu",
+					       newsize);
 				LOG_ERROR_STATUS(status);
 				status = -ENOSPC;
 			}
@@ -1655,7 +1663,7 @@
 	if (!ocfs2_inode_is_fast_symlink(inode)) {
 		status = ocfs_create_symlink_data(osb, handle, inode, symname);
 		if (status < 0) {
-			LOG_ERROR_STATUS (status);
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 	}
@@ -1663,7 +1671,7 @@
 	status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
 				parent_fe_bh, de_bh);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/ocfs_log.h
===================================================================
--- trunk/fs/ocfs2/ocfs_log.h	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/ocfs_log.h	2005-04-19 04:57:00 UTC (rev 2148)
@@ -364,11 +364,15 @@
 #define LOG_ERROR_ARGS(fmt, arg...)					\
 	do {								\
 		printk(KERN_ERR "(%d) ERROR at %s, %d: ", current->pid, __FILE__, __LINE__);        \
-		printk(fmt, ## arg);					\
+		printk(KERN_ERR fmt, ## arg);					\
 	} while (0)
 
 #define LOG_ERROR_STR(str)     LOG_ERROR_ARGS("%s\n", str)
-#define LOG_ERROR_STATUS(st)   LOG_ERROR_ARGS("status = %lld\n", (long long)(st))
+#define LOG_ERROR_STATUS(st)						\
+	do {								\
+		if ((st) != -ERESTARTSYS && (st) != -EINTR)			\
+			LOG_ERROR_ARGS("status = %lld\n", (long long)(st)); \
+	} while (0)
 
 #ifdef EVIL_TRACE
 #define LOG_SET_CONTEXT(ctxt) current->flags |= (OCFS_TRACE_ ## ctxt) << 24

Modified: trunk/fs/ocfs2/slot_map.c
===================================================================
--- trunk/fs/ocfs2/slot_map.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/slot_map.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -178,7 +178,8 @@
 
 	inode = ocfs_get_system_file_inode(osb, SLOT_MAP_SYSTEM_INODE, -1);
 	if (!inode) {
-		LOG_ERROR_STATUS(status = -EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/suballoc.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -433,8 +433,7 @@
 	ocfs_handle_add_inode(handle, alloc_inode);
 	status = ocfs2_meta_lock(alloc_inode, handle, &bh, 1);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 

Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/super.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -271,14 +271,16 @@
 
 	new = ocfs_iget(osb, osb->root_blkno);
 	if (!new) {
-		LOG_ERROR_STATUS(status = -EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	osb->root_inode = new;
 
 	new = ocfs_iget(osb, osb->system_dir_blkno);
 	if (!new) {
-		LOG_ERROR_STATUS(status = -EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	osb->sys_root_inode = new;
@@ -288,7 +290,8 @@
 		new = ocfs_get_system_file_inode(osb, i, osb->slot_num);
 		if (!new) {
 			ocfs_release_system_inodes(osb);
-			LOG_ERROR_STATUS(status = -EINVAL);
+			status = -EINVAL;
+			LOG_ERROR_STATUS(status);
 			/* FIXME: Should ERROR_RO_FS */
 			LOG_ERROR_ARGS("Unable to load system inode %d, possibly corrupt fs?", i);
 			goto bail;
@@ -317,7 +320,8 @@
 		new = ocfs_get_system_file_inode(osb, i, osb->slot_num);
 		if (!new) {
 			ocfs_release_system_inodes(osb);
-			LOG_ERROR_STATUS(status = -EINVAL);
+			status = -EINVAL;
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 		// the array now has one ref, so drop this one
@@ -429,14 +433,14 @@
 	inode = osb->root_inode;
 	if (!inode) {
 		status = -EIO;
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto read_super_error;
 	}
 
 	root = d_alloc_root (inode);
 	if (!root) {
 		status = -ENOMEM;
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		iput (inode);
 		inode = NULL;
 		goto read_super_error;
@@ -514,14 +518,15 @@
 
 	ocfs_table_header = register_sysctl_table(ocfs_root_table, 0);
 	if (!ocfs_table_header) {
-		LOG_ERROR_STATUS(status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	/* Initialize the memory slabs for oin and file entry */
 	status = ocfs_initialize_mem_caches();
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 	
@@ -622,8 +627,7 @@
 
 	status = ocfs2_meta_lock(inode, NULL, &bh, 0);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -754,7 +758,8 @@
 					   OCFS2_SUPER_BLOCK_BLKNO, 
 					   blksize);
 		if (tmpstat < 0) {
-			LOG_ERROR_STATUS(status = tmpstat);
+			status = tmpstat;
+			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 		di = (ocfs2_dinode *) (*bh)->b_data;
@@ -834,7 +839,8 @@
 	}
 
 	if ((osb = kmalloc (sizeof(ocfs_super), GFP_KERNEL)) == NULL) {
-		LOG_ERROR_STATUS (status = -ENOMEM);
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 	memset(osb, 0, sizeof(ocfs_super));
@@ -851,38 +857,38 @@
 	/* s_blocksize was set in the probe */
 	status = ocfs_initialize_osb(osb, bh);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs2_fill_local_node_info(osb);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs2_register_hb_callbacks(osb);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs2_dlm_init(osb);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	/* requires vote_thread to be running. */
 	status = ocfs2_register_net_handlers(osb);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
 	status = ocfs2_super_lock(osb, 1);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 	unlock_super = 1;
@@ -890,7 +896,7 @@
 	/* This will load up the node map and add ourselves to it. */
 	status = ocfs2_find_slot(osb);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -911,7 +917,7 @@
 	LOG_TRACE_STR ("ocfs_check_volume...");
 	status = ocfs_check_volume (osb);
 	if (status < 0) {
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
 
@@ -922,7 +928,7 @@
 	 * try to clean us up while we're live! */
 	status = ocfs2_request_mount_vote(osb);
 	if (status < 0)
-		LOG_ERROR_STATUS (status);
+		LOG_ERROR_STATUS(status);
 
 leave:
 	if (unlock_super)
@@ -1216,7 +1222,8 @@
 	 */	
 	inode = ocfs_get_system_file_inode(osb, HEARTBEAT_SYSTEM_INODE, -1);
 	if (!inode) {
-		LOG_ERROR_STATUS(status = -EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -1236,7 +1243,8 @@
 	 */	
 	inode = ocfs_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE, -1);
 	if (!inode) {
-		LOG_ERROR_STATUS(status = -EINVAL);
+		status = -EINVAL;
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 	

Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c	2005-04-18 18:35:25 UTC (rev 2147)
+++ trunk/fs/ocfs2/vote.c	2005-04-19 04:57:00 UTC (rev 2148)
@@ -604,8 +604,7 @@
 
 	status = ocfs2_broadcast_vote(osb, request, response_id, &response);
 	if (status < 0) {
-		if (status != -EINTR)
-			LOG_ERROR_STATUS(status);
+		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
 
@@ -629,12 +628,11 @@
 	status = -EAGAIN;
 	while (status == -EAGAIN) {
 		if (signal_pending(current))
-			return -EINTR;
+			return -ERESTARTSYS;
 
 		status = ocfs2_super_lock(osb, 0);
 		if (status < 0) {
-			if (status != -EINTR)
-				LOG_ERROR_STATUS(status);
+			LOG_ERROR_STATUS(status);
 			break;
 		}
 
@@ -673,7 +671,7 @@
 	status = -EAGAIN;
 	while (status == -EAGAIN) {
 		if (signal_pending(current))
-			return -EINTR;
+			return -ERESTARTSYS;
 
 		if (ocfs_node_map_is_only(osb, &osb->mounted_map,
 					  osb->node_num))



More information about the Ocfs2-commits mailing list