[LTP] [PATCH] dio_read: fix infinite loop when readsize >= filesize
Petr Vorel
pvorel@suse.cz
Tue Mar 24 09:20:47 CET 2026
Hi Andrea,
> 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.
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
> There's a sporadic failure in DOR000 that causes test to loop
> indefinetly under s390x. This patch tries to fix the issue by ensuring
> test will check runtime and if children completed.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
As a fix for indefinite loop LGTM. But why it happen readsize >= filesize? These
are related to -r and -s values, but we always use -r 512k -w 512k -s 32M.
I wonder why this happen only on s390x? (I'd expect ppc64le which has different
page size.
Also that means that pread() is skipped when this happen.
Kind regards,
Petr
More information about the ltp
mailing list