Skip to contentSkip to conversation

Test consistent file position updates

PATCH Superseded Dylan Yudaken 1 participant 1 message Feb 17, 2022 io_uring

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Test consistent file position updates

read(2)/write(2) and friends support sequential reads without giving an explicit offset. The result of these should leave the file with an incremented offset.

Add tests for both read and write to check that io_uring behaves consistently in these scenarios. Expect that if you queue many reads/writes, and set the IOSQE_IO_LINK flag, that they will behave similarly to calling read(2)/write(2) in sequence.

Set IOSQE_ASYNC as well in a set of tests. This exacerbates the problem by forcing work to happen in different threads to submission.

Also add tests for not setting IOSQE_IO_LINK, but do not treat these results as errors. It is not clear to me what the outcome of many overlapping read(2) should be in io_uring. In the read(2) etc calls a lock is taken on the file preventing concurrent accesses - but I am not convinced this should happen in the io_uring case.

---
 test/Makefile |   1 +
 test/fpos.c   | 254 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 255 insertions(+)
 create mode 100644 test/fpos.c
test/Makefile +1 -0
index 1e318f7..f421f53 100644
@@ -78,6 +78,7 @@ test_srcs := \
 	file-update.c \
 	file-verify.c \
 	fixed-link.c \
+	fpos.c \
 	fsync.c \
 	hardlink.c \
 	io-cancel.c \
test/fpos.c new file +254 -0

254 lines not on this page · raw message

base-commit: 20bb37e0f828909742f845b8113b2bb7e1065cd1

Signature · 1 line
2.30.2