[Ocfs2-commits] mfasheh commits r1239 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Jul 6 13:53:20 CDT 2004
Author: mfasheh
Date: 2004-07-06 12:53:18 -0500 (Tue, 06 Jul 2004)
New Revision: 1239
Modified:
trunk/src/alloc.c
Log:
* commit a patch by <xiaofeng.ling at intel.com>:
It seems the inode lock system map file is not released after
acquired.That causes when another node want to acquire it, this node
found it is already holded.
* fix a memory leak of the inode_alloc_free array in
ocfs_free_disk_bitmap
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-07-02 23:52:30 UTC (rev 1238)
+++ trunk/src/alloc.c 2004-07-06 17:53:18 UTC (rev 1239)
@@ -482,6 +482,19 @@
}
for (i = 0; i < osb->max_nodes; i++) {
+ if (inode_alloc_free[i] != NULL) {
+ down_write(&OCFS_I(inode_alloc_inode[i])->ip_io_sem);
+ status = ocfs_release_lock (osb,
+ OCFS_LKM_EXMODE,
+ FLAG_FILE_CREATE,
+ NULL, inode_alloc_inode[i]);
+ up_write(&OCFS_I(inode_alloc_inode[i])->ip_io_sem);
+ if (status < 0) {
+ LOG_ERROR_STATUS (status);
+ goto finally;
+ }
+ }
+
if (ext_alloc_free[i] != NULL) {
down_write(&OCFS_I(ext_alloc_inode[i])->ip_io_sem);
status = ocfs_release_lock (osb,
@@ -497,6 +510,13 @@
}
finally:
+ if (inode_alloc_inode) {
+ for (i = 0; i < osb->max_nodes; i++) {
+ if (inode_alloc_inode[i])
+ iput(inode_alloc_inode[i]);
+ }
+ kfree(inode_alloc_inode);
+ }
if (ext_alloc_inode) {
for (i = 0; i < osb->max_nodes; i++) {
@@ -520,6 +540,14 @@
kfree(ext_alloc_free);
}
+ if (inode_alloc_free) {
+ for (i = 0; i < osb->max_nodes; i++) {
+ if (inode_alloc_free[i])
+ kfree(inode_alloc_free[i]);
+ }
+ kfree(inode_alloc_free);
+ }
+
if (free_vol_bits)
kfree(free_vol_bits);
More information about the Ocfs2-commits
mailing list