summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-11-23 23:20:27 +0000
committerJens Axboe <axboe@kernel.dk>2020-11-24 07:54:30 -0700
commit9c3a205c5ffa36e96903c2e37eb5f41c0f03c43e (patch)
tree8610ee1aad55211ccf5b8edb09f0f643ce304a5a /fs
parenteb2667b343361863da7b79be26de641e22844ba0 (diff)
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: ff6165b2d7f6 ("io_uring: retain iov_iter state over io_read/io_write calls") Reported-by: David Howells <dhowells@redhat.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Cc: <stable@vger.kernel.org> # 5.9 Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index f971589878bc..ff6deffe5aa9 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;