[PATCH liburing] test/lfs-open: less limited test_drained_files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



close(dup(io_uring)) should not neccessary cancel all requests with
files, because files are not yet going away. Test that it doesn't hang
after close() and exits, that's enough.

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
 test/lfs-openat.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/test/lfs-openat.c b/test/lfs-openat.c
index 921e2a1..3fa0b99 100644
--- a/test/lfs-openat.c
+++ b/test/lfs-openat.c
@@ -202,18 +202,11 @@ static int test_drained_files(int dfd, const char *fn, bool linked, bool prepend
 		return 1;
 	}
 
-	/* io_uring->flush() */
+	/*
+	 * close(), which triggers ->flush(), and io_uring_queue_exit()
+	 * should successfully return and not hang.
+	 */
 	close(fd);
-
-	for (i = 0; i < to_cancel; i++) {
-		ret = io_uring_wait_cqe(&ring, &cqe);
-		if (cqe->res != -ECANCELED) {
-			fprintf(stderr, "fail cqe->res=%d\n", cqe->res);
-			return 1;
-		}
-		io_uring_cqe_seen(&ring, cqe);
-	}
-
 	io_uring_queue_exit(&ring);
 	return 0;
 }
-- 
2.24.0




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux