7 Commits

Author SHA1 Message Date
fangzhiyi18 0ae77b95ef 升级2.7
Signed-off-by: fangzhiyi18 <fangzhiyi1@huawei.com>
2024-10-21 02:53:20 +00:00
Ammar Faizi e8ae77b724 test/fpos: Fix reading from uninitialized buffer
Fix this:

  ==3054875== Conditional jump or move depends on uninitialised value(s)
  ==3054875==    at 0x109898: test_read (fpos.c:109)
  ==3054875==    by 0x109898: main (fpos.c:243)
  ==3054875==
  ==3054875== Conditional jump or move depends on uninitialised value(s)
  ==3054875==    at 0x10987B: test_read (fpos.c:111)
  ==3054875==    by 0x10987B: main (fpos.c:243)

Link: https://github.com/axboe/liburing/issues/640
Reported-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Link: https://lore.kernel.org/r/20220810002735.2260172-6-ammar.faizi@intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-08-10 07:02:50 -06:00
Eli Schwartz dd35f16b1d tests: emit a skip exit code if invoked with additional argv
These are skipped because they are not applicable if files/devices are
provided for a special test run. Note this in the return status.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2022-06-28 10:37:33 -04:00
Eli Schwartz 3467e7ac6d tests: migrate some tests to use enum-based exit codes
For maintainability and clarity, eschew the use of integer literals in
reporting test statuses. Instead, use a helper enum which contains
various values from the GNU exitcode protocol. Returning 0 or 1 is
obvious, and in the previous commit the ability to read "skip" (77) was
implemented. The final exit status is 99, which indicates some kind of
error in running the test itself.

A partial migration of existing pass/fail values in test sources is
included.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2022-06-28 10:37:33 -04:00
Dylan Yudaken ea2bb9aaea Remove fpos tests without linking
There are still more discussions ([1]) to see how to have consistent
r/w results without link, so do not test these cases.

[1] https://lore.kernel.org/io-uring/568473ab-8cf7-8488-8252-e8a2c0ec586f@kernel.dk

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220224105015.1324208-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-24 07:04:26 -07:00
Jens Axboe 74b96d7a15 test/fpos: fix for 32-bit compiles
Fixes: f75a6bb839 ("Test consistent file position updates")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-23 16:50:44 -07:00
Dylan Yudaken f75a6bb839 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.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-23 16:39:19 -07:00