[LTP] readahead02: Fall back to the parent disk's BDI for partitions

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Aug 21 08:53:35 CEST 2026


Hi Victor,

On Fri, 21 Aug 2026, Victor Cheng-Yen Yang wrote:
> readahead02: Fall back to the parent disk's BDI for partitions

> +		snprintf(sys_bdi_ra_path, sizeof(sys_bdi_ra_path),
> +			"/sys/class/block/%s/../bdi/read_ahead_kb", backing_dev);
> +		if (access(sys_bdi_ra_path, F_OK))
> +			return;
> +	}
>
> 	SAFE_FILE_SCANF(sys_bdi_ra_path, "%d", &orig_bdi_limit);
>
> 	if (orig_bdi_limit)
> 		SAFE_FILE_PRINTF(sys_bdi_ra_path, "%d", orig_bdi_limit);

Could restoration track whether the value was read separately from its
numeric value? The kernel accepts zero for read_ahead_kb, so if the parent
BDI starts at zero, setup writes a positive value but cleanup skips the
restore. This leaves the parent and its sibling partitions modified after
the test.

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