public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing] Remove fpos tests without linking
@ 2022-02-24 10:50 Dylan Yudaken
  2022-02-24 14:04 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Yudaken @ 2022-02-24 10:50 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov, io-uring; +Cc: kernel-team, Dylan Yudaken

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH liburing] Remove fpos tests without linking
  2022-02-24 10:50 [PATCH liburing] Remove fpos tests without linking Dylan Yudaken
@ 2022-02-24 14:04 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-02-24 14:04 UTC (permalink / raw)
  To: Dylan Yudaken, Pavel Begunkov, io-uring; +Cc: kernel-team

On Thu, 24 Feb 2022 02:50:15 -0800, Dylan Yudaken wrote:
> 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]
> 
> 

Applied, thanks!

[1/1] Remove fpos tests without linking
      commit: 896a1d3ab14a8777a45db6e7b67cf557a44923fb

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-24 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-24 10:50 [PATCH liburing] Remove fpos tests without linking Dylan Yudaken
2022-02-24 14:04 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox