Re: [PATCH 1/4] Revert "ceph: fix dentry leak in splice_dentry()"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 28, 2018 at 11:44 AM Yan, Zheng <zyan@xxxxxxxxxx> wrote:
>
> This reverts commit 8b8f53af1ed9df88a4c0fbfdf3db58f62060edf3.
>
> splice_dentry() is used by three places. For two places, req->r_dentry
> is passed to splice_dentry(). In the case of error, req->r_dentry does
> not get updated. So splice_dentry() should not drop reference.
>
> Cc: stable@xxxxxxxxxxxxxxx #4.18
> Signed-off-by: "Yan, Zheng" <zyan@xxxxxxxxxx>
> ---
>  fs/ceph/inode.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index c6bbb7aa99e4..375924b2bc86 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -1140,7 +1140,6 @@ 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) {

I think this needs a comment, at the very least.  The implicit contract
here is clearly way too confusing.

Thanks,

                Ilya



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux