Test consistent file position updates
PATCH v3 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 allow the file offset to progress past the end of the file.
---
v2:
- fixed a bug in how cqe ordering was processed
- enforce sequential reads for !IOSQE_IO_LINK
v3:
- lots of style cleanups
- do not output on success
test/Makefile | 1 +
test/fpos.c | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 257 insertions(+) create mode 100644 test/fpos.c
test/Makefile +1 -0
@@ -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 +256 -0
256 lines not on this page · raw message
base-commit: 20bb37e0f828909742f845b8113b2bb7e1065cd1
Signature · 1 line
2.30.2
Quoted 9 lines · Dylan Yudaken
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_uringbehaves consistently in these scenarios. Expect that if you queue many reads/writes, and set theIOSQE_IO_LINKflag, that they will behave similarly to calling read(2)/write(2) in sequence.
Quoted 5 lines
Set
IOSQE_ASYNCas 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 allow the file offset to progress past the end of the file.
Applied, thanks.
Signature · 1 line
Jens Axboe