Re: [PATCH RFC v3 17/17] fuse: {uring} Pin the user buffer

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

 



On 9/1/24 7:37 AM, Bernd Schubert wrote:
> @@ -465,53 +486,41 @@ static int fuse_uring_out_header_has_err(struct fuse_out_header *oh,
>  
>  static int fuse_uring_copy_from_ring(struct fuse_ring *ring,
>  				     struct fuse_req *req,
> -				     struct fuse_ring_ent *ent)
> +				     struct fuse_ring_ent *ent,
> +				     struct fuse_ring_req *rreq)
>  {
> -	struct fuse_ring_req __user *rreq = ent->rreq;
>  	struct fuse_copy_state cs;
>  	struct fuse_args *args = req->args;
>  	struct iov_iter iter;
> -	int err;
> -	int res_arg_len;
> +	int res_arg_len, err;
>  
> -	err = copy_from_user(&res_arg_len, &rreq->in_out_arg_len,
> -			     sizeof(res_arg_len));
> -	if (err)
> -		return err;
> -
> -	err = import_ubuf(ITER_SOURCE, (void __user *)&rreq->in_out_arg,
> -			  ent->max_arg_len, &iter);
> -	if (err)
> -		return err;
> +	res_arg_len = rreq->in_out_arg_len;
>  
>  	fuse_copy_init(&cs, 0, &iter);
>  	cs.is_uring = 1;
> +	cs.ring.pages = &ent->user_pages[FUSE_RING_PAYLOAD_PG];
>  	cs.req = req;
>  
> -	return fuse_copy_out_args(&cs, args, res_arg_len);
> +	err = fuse_copy_out_args(&cs, args, res_arg_len);
> +
> +	return err;
>  }

This last assignment, and 'err' in general, can go away after this
patch.

-- 
Jens Axboe





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux