aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2015-02-01 22:27:56 -0500
committerIlya Dryomov <idryomov@gmail.com>2015-02-19 05:31:40 -0500
commit5cba372c0fe78d24e83d9e0556ecbeb219625c15 (patch)
treedcb8742257a0243d9afbe157cb6f6222afd98371 /fs
parent3de22be6771353241eaec237fe594dfea3daf30f (diff)
ceph: fix dentry leaks
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/dir.c1
-rw-r--r--fs/ceph/inode.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 709f3b98ca5c..77eeb768f95a 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -676,6 +676,7 @@ int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry)
676 */ 676 */
677 BUG_ON(!result->d_inode); 677 BUG_ON(!result->d_inode);
678 d_instantiate(dentry, result->d_inode); 678 d_instantiate(dentry, result->d_inode);
679 d_drop(result);
679 return 0; 680 return 0;
680 } 681 }
681 return PTR_ERR(result); 682 return PTR_ERR(result);
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index f88a0f059dc8..be3af18e4cf1 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1449,12 +1449,14 @@ retry_lookup:
1449 } 1449 }
1450 1450
1451 if (!dn->d_inode) { 1451 if (!dn->d_inode) {
1452 dn = splice_dentry(dn, in, NULL); 1452 struct dentry *realdn = splice_dentry(dn, in, NULL);
1453 if (IS_ERR(dn)) { 1453 if (IS_ERR(realdn)) {
1454 err = PTR_ERR(dn); 1454 err = PTR_ERR(realdn);
1455 d_drop(dn);
1455 dn = NULL; 1456 dn = NULL;
1456 goto next_item; 1457 goto next_item;
1457 } 1458 }
1459 dn = realdn;
1458 } 1460 }
1459 1461
1460 di = dn->d_fsdata; 1462 di = dn->d_fsdata;