mbox series

[v2,0/3] io_uring: mshot read fix for buffer size changes

Message ID 20231106203909.197089-1-dyudaken@gmail.com (mailing list archive)
Headers show
Series io_uring: mshot read fix for buffer size changes | expand

Message

Dylan Yudaken Nov. 6, 2023, 8:39 p.m. UTC
Hi,

This series fixes a bug (see [1] for liburing patch)
where the used buffer size is clamped to the minimum of all the
previous buffers selected.

It also as part of this forces the multishot read API to set addr &
len to 0.
len should probably have some accounting post-processing if it has
meaning to set it to non-zero, but I think for a new API it is simpler
to overly-constrain it upfront?

addr is useful to force to zero as it will allow some more bits to be
used in `struct io_rw`, which is otherwise full.

v2:
 - apply comments
 - add a patch for io_kbuf_recycle to show if it did anything

[1]: https://github.com/axboe/liburing/pull/981

Dylan Yudaken (3):
  io_uring: indicate if io_kbuf_recycle did recycle anything
  io_uring: do not allow multishot read to set addr or len
  io_uring: do not clamp read length for multishot read

 io_uring/kbuf.c |  6 +++---
 io_uring/kbuf.h | 13 ++++++++-----
 io_uring/rw.c   | 13 ++++++++++++-
 3 files changed, 23 insertions(+), 9 deletions(-)


base-commit: f688944cfb810986c626cb13d95bc666e5c8a36c

Comments

Jens Axboe Nov. 6, 2023, 8:42 p.m. UTC | #1
On Mon, 06 Nov 2023 20:39:06 +0000, Dylan Yudaken wrote:
> This series fixes a bug (see [1] for liburing patch)
> where the used buffer size is clamped to the minimum of all the
> previous buffers selected.
> 
> It also as part of this forces the multishot read API to set addr &
> len to 0.
> len should probably have some accounting post-processing if it has
> meaning to set it to non-zero, but I think for a new API it is simpler
> to overly-constrain it upfront?
> 
> [...]

Applied, thanks!

[1/3] io_uring: indicate if io_kbuf_recycle did recycle anything
      commit: 89d528ba2f8281de61163c6b62e598b64d832175
[2/3] io_uring: do not allow multishot read to set addr or len
      commit: 49fbe99486786661994a55ced855c31d966bbdf0
[3/3] io_uring: do not clamp read length for multishot read
      commit: e53759298a7d7e98c3e5c2440d395d19cea7d6bf

Best regards,