]> Git Repo - linux.git/commitdiff
io_uring: fix ITER_BVEC check
authorPavel Begunkov <[email protected]>
Mon, 23 Nov 2020 23:20:27 +0000 (23:20 +0000)
committerJens Axboe <[email protected]>
Tue, 24 Nov 2020 14:54:30 +0000 (07:54 -0700)
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 <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
Cc: <[email protected]> # 5.9
Signed-off-by: Jens Axboe <[email protected]>
fs/io_uring.c

index f971589878bc290da55ff48034c733ca1e02c86e..ff6deffe5aa938114476c690b5fa7aee19b40369 100644 (file)
@@ -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;
This page took 0.067049 seconds and 4 git commands to generate.