Re: [PATCH] ceph: fix double free for req when failing to allocate sparse ext map

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

 



On Wed, 2023-01-11 at 09:14 +0800, xiubli@xxxxxxxxxx wrote:
> From: Xiubo Li <xiubli@xxxxxxxxxx>
> 
> Introduced by commit d1f436736924 ("ceph: add new mount option to enable
> sparse reads") and will fold this into the above commit since it's
> still in the testing branch.
> 
> Reported-by: Ilya Dryomov <idryomov@xxxxxxxxx>
> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
> ---
>  fs/ceph/addr.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 17758cb607ec..3561c95d7e23 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -351,10 +351,8 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
>  
>  	if (sparse) {
>  		err = ceph_alloc_sparse_ext_map(&req->r_ops[0]);
> -		if (err) {
> -			ceph_osdc_put_request(req);
> +		if (err)
>  			goto out;
> -		}
>  	}
>  
>  	dout("%s: pos=%llu orig_len=%zu len=%llu\n", __func__, subreq->start, subreq->len, len);

Looks right.

Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux