[LTP] [PATCH] dio_read: fix infinite loop when readsize >= filesize
Cyril Hrubis
chrubis@suse.cz
Tue Mar 24 14:21:10 CET 2026
Hi!
> The do_direct_reads() function had exit conditions inside the inner
> for loop. When readsize >= filesize, the for loop condition is never
> true, causing the while(1) loop to spin infinitely without checking
> if writers completed or runtime expired.
>
> Move the exit condition checks outside the for loop to ensure they
> are evaluated on every iteration, regardless of readsize/filesize
> parameters.
I was looking at this when I was rewriting the runtest files and I was
wondering why we do not check that filesize <= readsize && filesize <=
writesize in the test setup() instead.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list