Skip to content

Commit

Permalink
ceph: fix dentry leaks
Browse files Browse the repository at this point in the history
Signed-off-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
Yan, Zheng authored and Ilya Dryomov committed Feb 19, 2015
1 parent 3de22be commit 5cba372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry)
*/
BUG_ON(!result->d_inode);
d_instantiate(dentry, result->d_inode);
d_drop(result);
return 0;
}
return PTR_ERR(result);
Expand Down
8 changes: 5 additions & 3 deletions fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,12 +1449,14 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
}

if (!dn->d_inode) {
dn = splice_dentry(dn, in, NULL);
if (IS_ERR(dn)) {
err = PTR_ERR(dn);
struct dentry *realdn = splice_dentry(dn, in, NULL);
if (IS_ERR(realdn)) {
err = PTR_ERR(realdn);
d_drop(dn);
dn = NULL;
goto next_item;
}
dn = realdn;
}

di = dn->d_fsdata;
Expand Down

0 comments on commit 5cba372

Please sign in to comment.