summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-04-11 09:00:47 -0600
committerJens Axboe <axboe@kernel.dk>2019-04-11 09:00:47 -0600
commit093e902c28f5f52c2321c9d6bb86a242e8827859 (patch)
treece04869e2eb186c8b016c883656c448d599e7b9b
parent986440978828fb13453ad64fc70bb13ec8f745d8 (diff)
test/fsync: error out if we submit less than we wanted
This failure is expected on kernels that don't support the DRAIN primitive. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/fsync.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/fsync.c b/test/fsync.c
index b854a44..deacc5d 100644
--- a/test/fsync.c
+++ b/test/fsync.c
@@ -95,7 +95,10 @@ static int test_barrier_fsync(struct io_uring *ring)
sqe->flags = IOSQE_IO_DRAIN;
ret = io_uring_submit(ring);
- if (ret <= 0) {
+ if (ret < 5) {
+ printf("Submitted only %d\n", ret);
+ goto err;
+ } else if (ret < 0) {
printf("sqe submit failed\n");
if (ret == EINVAL)
printf("kernel may not support barrier fsync yet\n");