[Ocfs2-tools-commits] taoma commits r1340 - trunk/libocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Apr 11 19:57:16 PDT 2007


Author: taoma
Date: 2007-04-11 19:57:13 -0700 (Wed, 11 Apr 2007)
New Revision: 1340

Modified:
   trunk/libocfs2/expanddir.c
Log:
Fix a possible error in ocfs2_expand_dir.

Set cinode to NULL after the function ocfs2_free_cached_inode.
In the original code, if ocfs2_extend_allocation fails, another
ocfs2_free_cached_inode will be called at bail and make the 
program segment fault. 

Signed-off-by:jlbec

Modified: trunk/libocfs2/expanddir.c
===================================================================
--- trunk/libocfs2/expanddir.c	2007-04-11 19:19:01 UTC (rev 1339)
+++ trunk/libocfs2/expanddir.c	2007-04-12 02:57:13 UTC (rev 1340)
@@ -74,6 +74,7 @@
 
 	if (used_blks >= totl_blks) {
 		ocfs2_free_cached_inode(fs, cinode);
+		cinode = NULL;
 
 		/* extend the directory */
 		ret = ocfs2_extend_allocation(fs, dir, 1);




More information about the Ocfs2-tools-commits mailing list