From 7ef530b917a13ed01ec7b354095f1704800db0e8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 1 Nov 2024 09:29:33 -0600 Subject: [PATCH] test/cmd-discard: skip test on EINVAL/EBUSY open Particularly -EBUSY can happen if the device is mounted or already used, just skip for that. Signed-off-by: Jens Axboe --- test/cmd-discard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/cmd-discard.c b/test/cmd-discard.c index eddb5b720..1f3096e61 100644 --- a/test/cmd-discard.c +++ b/test/cmd-discard.c @@ -199,6 +199,8 @@ static int basic_cmd_test(struct io_uring *ring, int op) fd = open(filename, O_DIRECT | O_RDWR | O_EXCL); if (fd < 0) { + if (errno == -EINVAL || errno == -EBUSY) + return T_EXIT_SKIP; fprintf(stderr, "open failed %i\n", errno); return T_EXIT_FAIL; }