From: Dylan Yudaken <[email protected]>
To: Jens Axboe <[email protected]>,
Pavel Begunkov <[email protected]>,
<[email protected]>
Cc: <[email protected]>, Dylan Yudaken <[email protected]>
Subject: [PATCH liburing] Remove fpos tests without linking
Date: Thu, 24 Feb 2022 02:50:15 -0800 [thread overview]
Message-ID: <[email protected]> (raw)
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/[email protected]
Signed-off-by: Dylan Yudaken <[email protected]>
---
test/fpos.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/test/fpos.c b/test/fpos.c
index 385db63..78a6152 100644
--- a/test/fpos.c
+++ b/test/fpos.c
@@ -40,8 +40,7 @@ static void create_file(const char *file, size_t size)
assert(ret == size);
}
-static int test_read(struct io_uring *ring, bool async, bool link,
- int blocksize)
+static int test_read(struct io_uring *ring, bool async, int blocksize)
{
int ret, fd, i;
bool done = false;
@@ -71,7 +70,7 @@ static int test_read(struct io_uring *ring, bool async, bool link,
sqe->user_data = i;
if (async)
sqe->flags |= IOSQE_ASYNC;
- if (link && i != QUEUE_SIZE - 1)
+ if (i != QUEUE_SIZE - 1)
sqe->flags |= IOSQE_IO_LINK;
}
ret = io_uring_submit_and_wait(ring, QUEUE_SIZE);
@@ -124,8 +123,7 @@ static int test_read(struct io_uring *ring, bool async, bool link,
ret = -1;
}
current = lseek(fd, 0, SEEK_CUR);
- if (current < expected || (current != expected && link)) {
- /* accept that with !link current may be > expected */
+ if (current != expected) {
fprintf(stderr, "f_pos incorrect, expected %ld have %ld\n",
(long) expected, (long) current);
ret = -1;
@@ -137,8 +135,7 @@ static int test_read(struct io_uring *ring, bool async, bool link,
}
-static int test_write(struct io_uring *ring, bool async,
- bool link, int blocksize)
+static int test_write(struct io_uring *ring, bool async, int blocksize)
{
int ret, fd, i;
struct io_uring_sqe *sqe;
@@ -167,7 +164,7 @@ static int test_write(struct io_uring *ring, bool async,
sqe->user_data = 1;
if (async)
sqe->flags |= IOSQE_ASYNC;
- if (link && i != QUEUE_SIZE - 1)
+ if (i != QUEUE_SIZE - 1)
sqe->flags |= IOSQE_IO_LINK;
}
ret = io_uring_submit_and_wait(ring, QUEUE_SIZE);
@@ -236,19 +233,18 @@ int main(int argc, char *argv[])
return 1;
}
- for (int test = 0; test < 16; test++) {
+ for (int test = 0; test < 8; test++) {
int async = test & 0x01;
- int link = test & 0x02;
- int write = test & 0x04;
- int blocksize = test & 0x08 ? 1 : 7;
+ int write = test & 0x02;
+ int blocksize = test & 0x04 ? 1 : 7;
ret = write
- ? test_write(&ring, !!async, !!link, blocksize)
- : test_read(&ring, !!async, !!link, blocksize);
+ ? test_write(&ring, !!async, blocksize)
+ : test_read(&ring, !!async, blocksize);
if (ret) {
- fprintf(stderr, "failed %s async=%d link=%d blocksize=%d\n",
+ fprintf(stderr, "failed %s async=%d blocksize=%d\n",
write ? "write" : "read",
- async, link, blocksize);
+ async, blocksize);
return -1;
}
}
base-commit: 8a2e43dad6475cfcecf91d79e3c4ed58bb5298e1
--
2.30.2
next reply other threads:[~2022-02-24 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 10:50 Dylan Yudaken [this message]
2022-02-24 14:04 ` [PATCH liburing] Remove fpos tests without linking Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox