OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
559c1e0
)
ceph: fix memory leak due to possible dentry init race
author
Sage Weil
<sage@newdream.net>
Fri, 23 Apr 2010 18:36:54 +0000
(11:36 -0700)
committer
Sage Weil
<sage@newdream.net>
Mon, 17 May 2010 22:25:23 +0000
(15:25 -0700)
Free dentry_info in error path.
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c
patch
|
blob
|
history
diff --git
a/fs/ceph/dir.c
b/fs/ceph/dir.c
index
33feac7
..
422794f
100644
(file)
--- a/
fs/ceph/dir.c
+++ b/
fs/ceph/dir.c
@@
-51,8
+51,11
@@
int ceph_init_dentry(struct dentry *dentry)
return -ENOMEM; /* oh well */
spin_lock(&dentry->d_lock);
- if (dentry->d_fsdata) /* lost a race */
+ if (dentry->d_fsdata) {
+ /* lost a race */
+ kmem_cache_free(ceph_dentry_cachep, di);
goto out_unlock;
+ }
di->dentry = dentry;
di->lease_session = NULL;
dentry->d_fsdata = di;