[LTP] [PATCH v3 1/2] fsetxattr02: Adapt test for kernel 7.1.0+ socket xattr support

Andrea Cervesato andrea.cervesato@suse.com
Fri Mar 20 08:46:19 CET 2026


Hi!

> +static void fix_sock(struct test_case *tc)
> +{
> +	/* dc0876b9846d ("xattr: support extended attributes on sockets") */
> +	if (socket_xattr_supported)
> +		tc->exp_err = 0;

There's a mix of `bool` and `int` here. I would just define tc->exp_err as `int`
and leave `bool` out of the test for consistency.

Also I was thinking that we shouldn't explicitly edit static variables meant
to describe the test scenario, so we probably need a local variable (also for
consistency).

    int exp_err = tc->exp_err;

    if (socket_xattr_supported)
        exp_err = 1;

I can add these two small things before merge if you agree with that.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list