Skip to content

Commit

Permalink
test/cmd-discard: fix missing EBUSY checks
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Nov 22, 2024
1 parent e64d789 commit 25b3d2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/cmd-discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ static int test_fail_edge_cases(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 Expand Up @@ -302,6 +304,8 @@ static int test_rdonly(struct io_uring *ring, int op)

fd = open(filename, O_DIRECT | O_RDONLY | 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 All @@ -315,6 +319,8 @@ static int test_rdonly(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 Expand Up @@ -354,6 +360,8 @@ int main(int argc, char *argv[])

fd = open(filename, O_DIRECT | O_RDONLY | 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 25b3d2d

Please sign in to comment.