[Ocfs2-commits] khackel commits r1153 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Jun 18 20:40:37 CDT 2004


Author: khackel
Date: 2004-06-18 19:40:36 -0500 (Fri, 18 Jun 2004)
New Revision: 1153

Modified:
   trunk/src/super.c
Log:
fix inode leak in system inode array

Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c	2004-06-18 22:08:51 UTC (rev 1152)
+++ trunk/src/super.c	2004-06-19 00:40:36 UTC (rev 1153)
@@ -262,7 +262,8 @@
 			LOG_ERROR_STATUS(status = -EINVAL);
 			goto bail;
 		}
-		osb->system_inodes[i] = new;
+		// the array now has one ref, so drop this one
+		iput(new);
 	}
 
 bail:
@@ -288,7 +289,8 @@
 			LOG_ERROR_STATUS(status = -EINVAL);
 			goto bail;
 		}
-		osb->system_inodes[i] = new;
+		// the array now has one ref, so drop this one
+		iput(new);
 	}
 
 bail:
@@ -751,6 +753,7 @@
 	status = ocfs_read_bh (osb, GET_INODE_FEOFF(inode), &bh, 0, inode);
 	if (status < 0) {
 		LOG_ERROR_STR("failed to read bitmap data");
+		iput (inode);
 		return -EIO;
 	}
 
@@ -792,6 +795,7 @@
 
 	brelse(bh);
 
+	iput (inode);
 	LOG_EXIT_INT (0);
 	return 0;
 }                               /* ocfs_statfs */



More information about the Ocfs2-commits mailing list