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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Aug 27 18:15:20 CDT 2004


Author: mfasheh
Date: 2004-08-27 18:15:18 -0500 (Fri, 27 Aug 2004)
New Revision: 1393

Modified:
   trunk/src/nm.c
Log:
* nm.c fixes:
 - take ip_sem around the extent map destroy/init for a truncate pages
   message
 - don't need to take io_sem in _drop_readonly_cache_lock. I believe
   this was making process_vote time out.
 - we weren't destroying the extent maps in
   ocfs_commit_inode_delete.

* clean up some printks in the delete case.



Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-08-27 22:56:22 UTC (rev 1392)
+++ trunk/src/nm.c	2004-08-27 23:15:18 UTC (rev 1393)
@@ -586,7 +586,7 @@
 	/* vote no if the file is still open. */
 	if (OCFS_I(inode)->ip_open_cnt > 0) {
 #ifdef VERBOSE_PROCESS_VOTE
-		printk("process_vote: open count = %u\n", 
+		printk("process_vote: (delete) open count = %u\n", 
 		       OCFS_I(inode)->ip_open_cnt);
 #endif
 		up(&(OCFS_I(inode)->ip_sem));
@@ -600,7 +600,7 @@
 	if (OCFS_I(inode)->ip_num_extends) {
 		spin_unlock(&oin_num_ext_lock);
 #ifdef VERBOSE_PROCESS_VOTE
-		printk("process_vote: extends pending\n");
+		printk("process_vote: (delete) extends pending\n");
 #endif
 		status = 0;
 		goto done;
@@ -624,6 +624,10 @@
 	d_prune_aliases (inode);
 	sync_mapping_buffers(inode->i_mapping);
 	ocfs_truncate_inode_pages(inode, 0);
+	down(&OCFS_I(inode)->ip_sem);
+	ocfs_extent_map_destroy(&OCFS_I(inode)->ip_ext_map);
+	ocfs_extent_map_init(&OCFS_I(inode)->ip_ext_map);
+	up(&OCFS_I(inode)->ip_sem);
 }
 
 /*
@@ -804,8 +808,10 @@
 				}
 
 				ocfs_truncate_inode_pages(inode, 0);
+				down(&OCFS_I(inode)->ip_sem);
 				ocfs_extent_map_destroy(&OCFS_I(inode)->ip_ext_map);
 				ocfs_extent_map_init(&OCFS_I(inode)->ip_ext_map);
+				up(&OCFS_I(inode)->ip_sem);
 			}
 			vote_response = FLAG_VOTE_NODE;
 			goto vote;
@@ -1274,11 +1280,9 @@
 	int status = 0;
 	int yield = ctxt->yield;
 
-	if (yield) {
-		/* this will wait until process_vote gets to the release */
-		down_write(&OCFS_I(inode)->ip_io_sem);
+	/* this will wait until process_vote gets to the release */
+	if (yield)
 		ocfs_acquire_lockres(lockres, 0); // ocfs_process_vote ocfs_acquire_lock
-	}
 
 	/* check these under the lock */	
 	if (lockres->readonly_node != osb->node_num ||
@@ -1311,9 +1315,7 @@
 			if (yield) {
 				/* from nm thread, give some time to waiters */
 				ocfs_release_lockres(lockres); // ocfs_process_vote ocfs_acquire_lock
-				up_write(&OCFS_I(inode)->ip_io_sem);
-
-				down_write(&OCFS_I(inode)->ip_io_sem);
+				ocfs_sleep(50);
 				ocfs_acquire_lockres(lockres, 0); // ocfs_process_vote ocfs_acquire_lock
 			}
 			continue;
@@ -1330,10 +1332,8 @@
 	lockres->lock_state &= ~FLAG_READONLY_DROPPING;
 
 leave:
-	if (yield) {
+	if (yield)
 		ocfs_release_lockres(lockres); // ocfs_process_vote ocfs_acquire_lock
-		up_write(&OCFS_I(inode)->ip_io_sem);
-	}
 
 	if (inode)
 		iput(inode);



More information about the Ocfs2-commits mailing list