From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] dio_read: fix infinite loop when readsize >= filesize
Date: Tue, 24 Mar 2026 14:21:10 +0100 [thread overview]
Message-ID: <acKPxuwkGSMZILyK@yuki.lan> (raw)
In-Reply-To: <20260324-fix_dio_read-v1-1-cf5dfa13e46a@suse.com>
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
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-03-24 13:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 8:08 [LTP] [PATCH] dio_read: fix infinite loop when readsize >= filesize Andrea Cervesato
2026-03-24 8:20 ` Petr Vorel
2026-03-24 9:08 ` Andrea Cervesato via ltp
2026-03-24 13:09 ` Andrea Cervesato via ltp
2026-03-24 13:21 ` Cyril Hrubis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acKPxuwkGSMZILyK@yuki.lan \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.