Skip to content

Commit

Permalink
preadv203: guarantee the subloop exit timely
Browse files Browse the repository at this point in the history
We observed that timeout is still occasionally happening even with
introducing the tst_remaining_runtime. The likely reason is that
writer_thread needs more time in subloop.

Here exit it instantly when stop set to 1.

Signed-off-by: Li Wang <liwang@redhat.com>
  • Loading branch information
wangli5665 committed Jun 21, 2023
1 parent db67c0b commit 81c36df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/preadv2/preadv203.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void *writer_thread(void *unused)
while (!stop) {
int fd = fds[random() % FILES];

for (j = 0; j < CHUNKS; j++) {
for (j = 0; j < CHUNKS && !stop; j++) {
memset(buf, '0' + j, sizeof(buf));

off_t off = CHUNK_SZ * j;
Expand Down

0 comments on commit 81c36df

Please sign in to comment.