[Ocfs2-commits] mfasheh commits r1709 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Dec 16 16:47:53 CST 2004


Author: mfasheh
Date: 2004-12-16 16:47:52 -0600 (Thu, 16 Dec 2004)
New Revision: 1709

Modified:
   trunk/src/vote.c
Log:
* fix a bug where nodes were sending a wrong vote response on unlink
  requests.

* add a fast path check in ocfs2_wait_on_vote_responses



Modified: trunk/src/vote.c
===================================================================
--- trunk/src/vote.c	2004-12-16 22:45:27 UTC (rev 1708)
+++ trunk/src/vote.c	2004-12-16 22:47:52 UTC (rev 1709)
@@ -221,6 +221,7 @@
 	       node_num);
 
 	vote_response = 0;
+
 	switch (request) {
 	case OCFS2_VOTE_REQ_UMOUNT:
 		ocfs2_process_umount_request(osb, node_num);
@@ -240,11 +241,12 @@
 	if (atomic_read(&osb->vol_state) == VOLUME_INIT)
 		goto respond;
 
-	vote_response = -EINVAL;
 	/* If we get here, then the request is against an inode. */
 	inode = ocfs_ilookup(osb, blkno);
-	if (!inode)
+	if (!inode) {
+		vote_response = -EINVAL;
 		goto respond;
+	}
 
 	OCFS_ASSERT(inode->i_generation == generation);
 
@@ -261,6 +263,7 @@
 	default:
 		printk("ocfs2_process_vote: node %u, invalid request: %u\n",
 		       node_num, request);
+		vote_response = -EINVAL;
 	}
 
 respond:
@@ -446,6 +449,9 @@
 	signed long timeout = OCFS2_RESPONSE_WAIT_JIFFIES;
 	DECLARE_WAITQUEUE(wait, current);
 
+	if (ocfs_node_map_is_empty(osb, &w->n_node_map))
+		return 0;
+
 	add_wait_queue(&w->n_event, &wait);
 	while (1) {
 		set_current_state(TASK_INTERRUPTIBLE);
@@ -494,11 +500,13 @@
 	printk("node map iterate: starting at %d, i am %d\n", i, osb->node_num);
 	while (i != OCFS_INVALID_NODE_NUM) {
 		if (i != osb->node_num) {
+			printk("trying to send request to node %i\n", i);
 			ocfs_node_map_set_bit(osb, &w->n_node_map, i);
 
 			remote_node = nm_get_node_by_num(i);
 			if (!remote_node) {
 				status = -EINVAL;
+				LOG_ERROR_STATUS(status);
 				goto bail;
 			}
 
@@ -520,6 +528,7 @@
 				status = remote_err;
 				printk("ocfs2: remote error %d on node %d!\n",
 				       remote_err, i);
+				LOG_ERROR_STATUS(status);
 				goto bail;
 			}
 			if (status < 0) {



More information about the Ocfs2-commits mailing list