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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed May 5 17:54:17 CDT 2004


Author: mfasheh
Date: 2004-05-05 16:54:16 -0500 (Wed, 05 May 2004)
New Revision: 898

Modified:
   trunk/src/dcache.c
Log:
* fix a null pointer crash in ocfs_dentry_revalidate (handle null inodes properly again)
* move the INODE_DELETED check up a bit as I think it needs to happen earlier


Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c	2004-05-05 21:31:17 UTC (rev 897)
+++ trunk/src/dcache.c	2004-05-05 21:54:16 UTC (rev 898)
@@ -52,14 +52,26 @@
         LOG_ENTRY_ARGS ("(0x%p, %d, '%*s')\n", dentry, flags,
                         dentry->d_name.len, dentry->d_name.name);
 
+	if (inode == NULL)
+		goto bail;
+
 	osb = OCFS_GENERIC_SB_P(inode->i_sb);
+
 	OCFS_ASSERT(osb);
-	
+
 	if (inode->i_ino == OCFS_ROOT_INODE_NUMBER) {
 		ret = 1;
 		goto bail;
 	}
 
+	/* did we or someone else delete this inode? */
+	if (INODE_DELETED(inode)) {
+		LOG_TRACE_ARGS("dentry_revalidate: inode %lu (%llu) deleted, "
+			       "returning false\n", inode->i_ino, 
+			       GET_INODE_VOTEOFF(inode));
+		goto bail;
+	}
+
 	if (osb->publ_map == (1 << osb->node_num)) {
 		LOG_TRACE_STR ("Only node alive.  revalidate=true.");
 		ret = 1;
@@ -72,14 +84,6 @@
 		goto bail;
 	}
 
-	/* did we or someone else delete this inode? */
-	if (INODE_DELETED(inode)) {
-		LOG_TRACE_ARGS("dentry_revalidate: inode %lu (%llu) deleted, "
-			       "returning false\n", inode->i_ino, 
-			       GET_INODE_VOTEOFF(inode));
-		goto bail;
-	}
-
 	ret = 1;  /* with an oin we cannot fail revalidate */
 
 	/* hit the disk */



More information about the Ocfs2-commits mailing list