Skip to content

Commit f274495

Browse files
committed
io_uring/kbuf: return correct iovec count from classic buffer peek
io_provided_buffers_select() returns 0 to indicate success, but it should be returning 1 to indicate that 1 vec was mapped. This causes peeking to fail with classic provided buffers, and while that's not a use case that anyone should use, it should still work correctly. The end result is that no buffer will be selected, and hence a completion with '0' as the result will be posted, without a buffer attached. Fixes: 35c8711 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers") Signed-off-by: Jens Axboe <[email protected]>
1 parent 1c47c0d commit f274495

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/kbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int io_provided_buffers_select(struct io_kiocb *req, size_t *len,
129129

130130
iov[0].iov_base = buf;
131131
iov[0].iov_len = *len;
132-
return 0;
132+
return 1;
133133
}
134134

135135
static struct io_uring_buf *io_ring_head_to_buf(struct io_uring_buf_ring *br,

0 commit comments

Comments
 (0)