[LTP] tse_swap: Add fallback definitions for swapon

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Thu Sep 3 18:01:37 CEST 2026


Hi Andrea,

On Thu, Sep 3, 2026, Andrea Cervesato wrote:
> [PATCH 1/3] tse_swap: Add fallback definitions for swapon

--- [PATCH 2/3] ---

> static struct tst_test test = {
> 	.needs_root = 1,
> 	.mount_device = 1,

SWAP_FLAG_DISCARD_ONCE and SWAP_FLAG_DISCARD_PAGES were added in Linux
3.11. Add `.min_kver = "3.11"`; older kernels reject these bits and the
test reports TFAIL instead of TCONF.

--- [PATCH 3/3] ---

> 	{
> 		.err_desc = "Invalid swapflags (undefined flag bits)",
> 		.exp_errno = EINVAL,
> 		.path = SWAP_FILE,
> 		.flags = 0x80000,
> 	},

Invalid swap flags started returning EINVAL in Linux 3.4. Add
`.min_kver = "3.4"` so the test skips older kernels, which may accept the
flags and produce spurious failures.

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