Re: [LTP] [PATCH v3] listmount04.c: Update case support mnt_id_req.mnt_ns_fd

Petr Vorel
2025-12-10T08:38:40Z

Hi Wei,

> Kernel change from v6.18-rc7 lead test case failure with following error message:
> listmount04.c:128: TFAIL: invalid mnt_id_req.spare expected EINVAL: EBADF (9)

> .req_usage = 1,
> @@ -122,7 +136,17 @@ static void run(unsigned int n)
> req->mnt_id = tc->mnt_id;
> req->param = tc->param;
> req->size = tc->size;
> - req->spare = tc->spare;
> +#ifdef HAVE_STRUCT_MNT_ID_REQ_MNT_NS_FD
> + if ((tst_kvercmp(6, 18, 0)) >= 0)
> + req->mnt_ns_fd = tc->mnt_ns_fd;
> + else
> + tst_brk(TCONF, "Skipping test, kernel version should > 6.18");
nit: "should be >= " (missing "be" and "=").

OK, for insufficient kernel version only first test (which does not set
.req_usage) will be run.

> +#else
> + if ((tst_kvercmp(6, 18, 0)) >= 0)
> + tst_brk(TCONF, "Skipping test, kernel version should < 6.18");
nit: "should be" (missing "be").

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks!

Kind regards,
Petr
> + else
> + req->spare = tc->spare;
> +#endif
> }