lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f95120c1-6f17-24a8-0cf4-666417a5c6c5@gmail.com>
Date:   Sat, 7 Nov 2020 01:14:24 +0000
From:   Pavel Begunkov <asml.silence@...il.com>
To:     David Laight <David.Laight@...LAB.COM>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "io-uring@...r.kernel.org" <io-uring@...r.kernel.org>,
        Jens Axboe <axboe@...nel.dk>,
        "David S. Miller" <davem@...emloft.net>,
        Al Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 4/9 next] fs/io_uring Don't use the return value from
 import_iovec().

On 15/09/2020 15:55, David Laight wrote:
> 
> This is the only code that relies on import_iovec() returning
> iter.count on success.
> This allows a better interface to import_iovec().

Seems this got nowhere. I'll pick it and send with some other
patches to Jens.

> Signed-off-by: David Laight <david.laight@...lab.com>
> ---
>  fs/io_uring.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 3790c7fe9fee..0df43882e4b3 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2824,7 +2824,7 @@ static ssize_t __io_import_iovec(int rw, struct io_kiocb *req,
>  
>  		ret = import_single_range(rw, buf, sqe_len, *iovec, iter);
>  		*iovec = NULL;
> -		return ret < 0 ? ret : sqe_len;
> +		return ret;
>  	}
>  
>  	if (req->flags & REQ_F_BUFFER_SELECT) {
> @@ -2853,7 +2853,7 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
>  	if (!req->io)
>  		return __io_import_iovec(rw, req, iovec, iter, needs_lock);
>  	*iovec = NULL;
> -	return iov_iter_count(&req->io->rw.iter);
> +	return 0;
>  }
>  
>  static inline loff_t *io_kiocb_ppos(struct kiocb *kiocb)
> @@ -3123,7 +3123,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
>  	if (ret < 0)
>  		return ret;
>  	iov_count = iov_iter_count(iter);
> -	io_size = ret;
> +	io_size = iov_count;
>  	req->result = io_size;
>  	ret = 0;
>  
> @@ -3246,7 +3246,7 @@ static int io_write(struct io_kiocb *req, bool force_nonblock,
>  	if (ret < 0)
>  		return ret;
>  	iov_count = iov_iter_count(iter);
> -	io_size = ret;
> +	io_size = iov_count;
>  	req->result = io_size;
>  
>  	/* Ensure we clear previously set non-block flag */
> 

-- 
Pavel Begunkov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ