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

[email protected] Mon, 3 Aug 2026 16:28:05 +0000
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
Hi Wake,

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

> 					usleep(usec);
> 					if (usec < 100000) /* cap backoff at 100ms */
> 						usec *= 2;

Could this clamp the doubled value to 100000 and only sleep when another
attempt remains? When usec is 64000, this condition doubles it to 128000, so
the advertised 100 ms cap is exceeded. The loops also sleep after the final
failed probe. As a result, the 50-attempt stat path can sleep for 5.631
seconds and the 20-attempt open path for 1.791 seconds.

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