ceph: fix dentry leak in splice_dentry()
authorYan, Zheng <zyan@redhat.com>
Tue, 19 Jun 2018 10:20:34 +0000 (18:20 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 26 Jun 2018 16:42:44 +0000 (18:42 +0200)
In any case, d_splice_alias() does not drop reference of original
dentry.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/inode.c

index ee764ac..a866be9 100644 (file)
@@ -1135,6 +1135,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) {