Re: lib: Use backoff polling to wait for loop device nodes

[email protected]
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.