From: Yan, Zheng Date: Tue, 19 Jun 2018 10:20:34 +0000 (+0800) Subject: ceph: fix dentry leak in splice_dentry() X-Git-Tag: v4.14.67~120 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=77c967872e8efe1341696bacfa1f793aedcc9f0d;p=users%2Fjedix%2Flinux-maple.git ceph: fix dentry leak in splice_dentry() [ Upstream commit 8b8f53af1ed9df88a4c0fbfdf3db58f62060edf3 ] In any case, d_splice_alias() does not drop reference of original dentry. Signed-off-by: "Yan, Zheng" Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index f2550a076edc..d5124ed35154 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1087,6 +1087,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in) if (IS_ERR(realdn)) { pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n", PTR_ERR(realdn), dn, in, ceph_vinop(in)); + dput(dn); dn = realdn; /* note realdn contains the error */ goto out; } else if (realdn) {