From: Pavel Begunkov Date: Mon, 23 Nov 2020 23:20:27 +0000 (+0000) Subject: io_uring: fix ITER_BVEC check X-Git-Tag: baikal/aarch64/sdk6.1~7831^2~1 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=a7b638ba682c6fdec0a0b904b603f9c1bb9b85d9;p=kernel.git io_uring: fix ITER_BVEC check iov_iter::type is a bitmask that also keeps direction etc., so it shouldn't be directly compared against ITER_*. Use proper helper. Fixes: 2f0408fc0be9 ("io_uring: retain iov_iter state over io_read/io_write calls") Reported-by: David Howells Signed-off-by: Pavel Begunkov Cc: # 5.9 Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index f971589878bc2..ff6deffe5aa93 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3193,7 +3193,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;