[Ocfs2-commits] mfasheh commits r1558 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Oct 7 19:11:20 CDT 2004
Author: mfasheh
Date: 2004-10-07 19:11:19 -0500 (Thu, 07 Oct 2004)
New Revision: 1558
Modified:
trunk/src/alloc.c
trunk/src/dir.c
trunk/src/file.c
trunk/src/namei.c
Log:
* some cleanup
* we were leaking buffers in delete_inode
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-10-07 22:42:32 UTC (rev 1557)
+++ trunk/src/alloc.c 2004-10-08 00:11:19 UTC (rev 1558)
@@ -1985,7 +1985,8 @@
*
* This will start, restart and commit your handle for you.
*
- * WARNING: This will gobble the contexts reference to last_eb_bh.
+ * WARNING: This will gobble the contexts reference to last_eb_bh
+ * *and* the journal handle.
*/
int ocfs_commit_truncate(ocfs_super *osb,
struct inode *inode,
@@ -2006,6 +2007,7 @@
last_eb_bh = tc->tc_last_eb_bh;
tc->tc_last_eb_bh = NULL;
handle = tc->tc_handle;
+ tc->tc_handle = NULL;
target_i_clusters = ocfs2_clusters_for_bytes(osb->sb,
inode->i_size);
@@ -2089,7 +2091,6 @@
goto start;
bail:
ocfs_commit_trans(handle);
- tc->tc_handle = NULL;
if (last_eb_bh)
brelse(last_eb_bh);
Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c 2004-10-07 22:42:32 UTC (rev 1557)
+++ trunk/src/dir.c 2004-10-08 00:11:19 UTC (rev 1558)
@@ -512,7 +512,7 @@
if (meta_ac)
ocfs_free_alloc_context(meta_ac);
- if ((status < 0) && new_bh)
+ if (new_bh)
brelse(new_bh);
LOG_EXIT_STATUS (status);
Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c 2004-10-07 22:42:32 UTC (rev 1557)
+++ trunk/src/file.c 2004-10-08 00:11:19 UTC (rev 1558)
@@ -978,7 +978,7 @@
if (handle)
ocfs_commit_trans(handle);
- if (fe_bh != NULL)
+ if (fe_bh)
brelse(fe_bh);
if (tc)
Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c 2004-10-07 22:42:32 UTC (rev 1557)
+++ trunk/src/namei.c 2004-10-08 00:11:19 UTC (rev 1558)
@@ -448,7 +448,7 @@
if (de_bh)
brelse(de_bh);
- if (parent_fe_bh != NULL)
+ if (parent_fe_bh)
brelse(parent_fe_bh);
if ((status < 0) && inode)
@@ -2193,7 +2193,7 @@
int namelen;
ocfs2_dinode *orphan_fe;
int status = 0;
- struct buffer_head *target_de_bh;
+ struct buffer_head *target_de_bh = NULL;
struct ocfs2_dir_entry *target_de = NULL;
LOG_ENTRY();
@@ -2259,6 +2259,9 @@
if (name)
kfree(name);
+ if (target_de_bh)
+ brelse(target_de_bh);
+
LOG_EXIT_STATUS(status);
return status;
}
More information about the Ocfs2-commits
mailing list