Skip to content

Commit

Permalink
test/cmd-discard: skip test on EINVAL/EBUSY open
Browse files Browse the repository at this point in the history
Particularly -EBUSY can happen if the device is mounted or already used,
just skip for that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Nov 1, 2024
1 parent d7e04e1 commit 7ef530b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/cmd-discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7ef530b

Please sign in to comment.