public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 5.10] io_uring: fix ITER_BVEC check
@ 2020-11-23 23:20 Pavel Begunkov
  2020-11-24 14:45 ` Jeff Moyer
  2020-11-24 14:53 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Begunkov @ 2020-11-23 23:20 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: stable, David Howells

iov_iter::type is a bitmask that also keeps direction etc., so it
shouldn't be directly compared against ITER_*. Use proper helper.

Cc: <[email protected]> # 5.9
Reported-by: David Howells <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 593dfef32b17..7c1f255807f5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3278,7 +3278,7 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec,
 	rw->free_iovec = iovec;
 	rw->bytes_done = 0;
 	/* can only be fixed buffers, no need to do anything */
-	if (iter->type == ITER_BVEC)
+	if (iov_iter_is_bvec(iter))
 		return;
 	if (!iovec) {
 		unsigned iov_off = 0;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5.10] io_uring: fix ITER_BVEC check
  2020-11-23 23:20 [PATCH 5.10] io_uring: fix ITER_BVEC check Pavel Begunkov
@ 2020-11-24 14:45 ` Jeff Moyer
  2020-11-24 14:53 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Moyer @ 2020-11-24 14:45 UTC (permalink / raw)
  To: Pavel Begunkov; +Cc: Jens Axboe, io-uring, stable, David Howells

Pavel Begunkov <[email protected]> writes:

> iov_iter::type is a bitmask that also keeps direction etc., so it
> shouldn't be directly compared against ITER_*. Use proper helper.
>
> Cc: <[email protected]> # 5.9
> Reported-by: David Howells <[email protected]>
> Signed-off-by: Pavel Begunkov <[email protected]>

Fixes: ff6165b2d7f6 ("io_uring: retain iov_iter state over io_read/io_write calls")

> ---
>  fs/io_uring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 593dfef32b17..7c1f255807f5 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -3278,7 +3278,7 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec,
>  	rw->free_iovec = iovec;
>  	rw->bytes_done = 0;
>  	/* can only be fixed buffers, no need to do anything */
> -	if (iter->type == ITER_BVEC)
> +	if (iov_iter_is_bvec(iter))
>  		return;
>  	if (!iovec) {
>  		unsigned iov_off = 0;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 5.10] io_uring: fix ITER_BVEC check
  2020-11-23 23:20 [PATCH 5.10] io_uring: fix ITER_BVEC check Pavel Begunkov
  2020-11-24 14:45 ` Jeff Moyer
@ 2020-11-24 14:53 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-11-24 14:53 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring; +Cc: stable, David Howells

On 11/23/20 4:20 PM, Pavel Begunkov wrote:
> iov_iter::type is a bitmask that also keeps direction etc., so it
> shouldn't be directly compared against ITER_*. Use proper helper.

Applied (with fixes added), thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-24 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23 23:20 [PATCH 5.10] io_uring: fix ITER_BVEC check Pavel Begunkov
2020-11-24 14:45 ` Jeff Moyer
2020-11-24 14:53 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox