ceph: fix dentry leaks
Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
parent
3de22be677
commit
5cba372c0f
@ -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);
|
||||
|
@ -1449,12 +1449,14 @@ retry_lookup:
|
||||
}
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user