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

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Sat Aug 8 03:32:46 CEST 2026


Hi Wake,

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

> +				path_set = TST_RETRY_FN_EXP_BACKOFF(
> +					set_dev_loop_path(rc, path, path_len),
> +					TST_RETVAL_EQ0, 1);

Could the backoff arithmetic be made overflow-safe before these two new
uses?

LTP_TIMEOUT_MUL=3000 is accepted by parse_mul(), which makes
tst_max_delay_ 3,000,000,000. The unsigned int tst_delay_ reaches
2,147,483,648, still compares less than tst_max_delay_, and then doubles
to zero. If the device node does not appear, both new paths then retry
forever instead of honoring the multiplied timeout.

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