Skip to content

Commit

Permalink
io_uring: fix ITER_BVEC check
Browse files Browse the repository at this point in the history
ANBZ: torvalds#190

commit 9c3a205 upstream.

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

Fixes: ff6165b ("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>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Reviewed-by: Hao Xu <haoxu@linux.alibaba.com>
Tested-by: Hao Xu <haoxu@linux.alibaba.com>
  • Loading branch information
isilence authored and josephhz committed Dec 31, 2021
1 parent a27d73e commit 265899c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec,
rw->free_iovec = NULL;
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;
Expand Down

0 comments on commit 265899c

Please sign in to comment.