[LTP] lib: Use backoff polling to wait for loop device nodes

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Aug 7 13:05:41 CEST 2026


Hi Wake,

On Aug 7, 2026, Wake Liu wrote:
> lib: Use backoff polling to wait for loop device nodes

> Introduce an exponential-backoff retry loop in both
> tst_find_free_loopdev() and tst_attach_device() (starting at 1ms delay,
> doubling each try, capped at 100ms) to wait for the device node to be
> successfully populated.

Could the timing description be corrected, or the implementation changed to
match it? TST_RETRY_FN_EXP_BACKOFF() starts tst_delay_ at 1 and passes it to
usleep(), so the first delay is 1 microsecond. MAX_DELAY is converted from
seconds to microseconds, so passing 1 retries for about one second before LTP
timeout scaling, not 100 ms.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list