Skip to content
Success

Changes

Summary

  1. tests/osmo_io_test: test_segmentation: Use osmo_iofd_close() API (details)
  2. tests/osmo_io_test (io_uring): test_segmentation: Fix infinite loop in (details)
  3. io_uring: Avoid extra reads if iofd becomes unregistered by user (details)
Commit 53cf62fe5ca1f3b86adb5e5d668ba507ff59ab96 by Pau Espin Pedrol
tests/osmo_io_test: test_segmentation: Use osmo_iofd_close() API

This is saner than doing osmo_iofd_unregister() + manual close().

Change-Id: Id910bfb4e0965700e2d378a513a9bf889b929d44
The file was modifiedtests/osmo_io/osmo_io_test.c
Commit 52647ba0c16f68aae17b2bc35538712e81492b63 by Pau Espin Pedrol
tests/osmo_io_test (io_uring): test_segmentation: Fix infinite loop in read_cb rc=0

Under linux 6.17.6-arch1-1 & liburing 2.12-1, once we finish reading
from the pipe (rc=0) because the write peer was closed and data has been
consumed, we end up in some sort of infinite loop in the uring due to
re-adding a sqe in iofd_uring_handle_recv()->iofd_uring_submit_recv()
path and immediatelly consuming a cqe from the uring, without going
through the poll() loop.

The user is expected to close the fd once rc=0 is received anyway, which
was not being done in this test. Doing so successfully unregisters the
iofd and fixes the infinite loop.

Fixes: 086ee51de416ae5276b4b185c055831e16c0ef85
Change-Id: I47b5fff04c601cd08ab2d46b88336247b2193808
The file was modifiedtests/osmo_io/osmo_io_test.c
Commit 32efc324ce0b30280effef4860bb15588ecb1010 by Pau Espin Pedrol
io_uring: Avoid extra reads if iofd becomes unregistered by user

The user callback (read_cb, segmentation_cb, etc.) may decide to
unregister the iofd instead of closing it. In this scenario, we should
avoid calling the callback further until the iofd is registered again.

Change-Id: I231d5a16768b730f67089090c244bcc10dc69c3a
The file was modifiedsrc/core/osmo_io_uring.c
The file was modifiedtests/osmo_io/osmo_io_test.c