[LTP] [PATCH] acct01: add EFAULT errno check

Petr Vorel pvorel@suse.cz
Fri Jun 21 14:00:53 CEST 2024


Hi Lu,

> 1. add EFAULT errno check.
> 2. fix make check errors and warnings.

Changes LGTM, but could you please separate these changes into it's own commit?

FYI it's a good habit to separate changes (easier to review, it would not be
clear what is EFAULT related change). We sometimes just mix these changes, but
here both changes are quite big + you even touch a different test.

> ---
...
>  testcases/kernel/syscalls/acct/acct01.c | 31 +++++++++++++++++--------
> -	TEST(acct(NULL));
> -	if (TST_RET == -1 && TST_ERR == ENOSYS)
> -		tst_brk(TCONF, "acct() system call isn't configured in kernel");
Good point. This was added in 2013 ba3bf0e34 ("acct01: add a check routine for
acct implementation") and was valid until you added now:

> +	.needs_kconfigs = (const char *[]) {
> +		"CONFIG_BSD_PROCESS_ACCT=y",
> +	},

@Cyril: would you replace ENOSYS with CONFIG_BSD_PROCESS_ACCT=y ?
I would try to avoid using .needs_kconfigs when ENOSYS can be checked.

Kind regards,
Petr

>  };
> diff --git a/testcases/kernel/syscalls/acct/acct02.c b/testcases/kernel/syscalls/acct/acct02.c
> index d3f3d9d04..74019f430 100644
> --- a/testcases/kernel/syscalls/acct/acct02.c
> +++ b/testcases/kernel/syscalls/acct/acct02.c
> @@ -186,7 +186,7 @@ static void run(void)

>  		if (read_bytes != acct_size) {
>  			tst_res(TFAIL, "incomplete read %i bytes, expected %i",
> -			        read_bytes, acct_size);
> +					read_bytes, acct_size);
>  			goto exit;
>  		}


More information about the ltp mailing list