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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Sep 2 13:46:40 CDT 2004


Author: mfasheh
Date: 2004-09-02 13:46:39 -0500 (Thu, 02 Sep 2004)
New Revision: 1416

Modified:
   trunk/src/inode.c
Log:
* take an extra ref. during acquire_lock from delete_inode as paths
  inside of acquire_lock do inc/iput.



Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-09-02 18:45:50 UTC (rev 1415)
+++ trunk/src/inode.c	2004-09-02 18:46:39 UTC (rev 1416)
@@ -625,10 +625,15 @@
 	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_DIR,
 			     orphan_dir_inode);
 
+	/* acquire_lock and friends will igrab / iput this guy, so we
+	 * take an extra ref. to avoid recursive calls to
+	 * delete_inode. */
+	atomic_inc(&inode->i_count);
 	if (S_ISDIR(inode->i_mode))
 		lock_flags |= FLAG_DIR;
 	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, lock_flags, 
 				   &fe_bh, inode);
+	atomic_set(&inode->i_count, 0);
 	if (status < 0) {
 		/* EBUSY here is assumed to mean that other nodes are
 		 * still using the inode. We're done here though, so



More information about the Ocfs2-commits mailing list