All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
@ 2024-05-16 16:43 Martin KaFai Lau
  2024-05-16 16:54 ` Alan Maguire
  2024-05-17  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Martin KaFai Lau @ 2024-05-16 16:43 UTC (permalink / raw)
  To: bpf; +Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team

From: Martin KaFai Lau <martin.lau@kernel.org>

The btf_dump test fails:

test_btf_dump_struct_data:FAIL:file_operations unexpected file_operations: actual '(struct file_operations){
	.owner = (struct module *)0xffffffffffffffff,
	.fop_flags = (fop_flags_t)4294967295,
	.llseek = (loff_t (*)(struct f' != expected '(struct file_operations){
	.owner = (struct module *)0xffffffffffffffff,
	.llseek = (loff_t (*)(struct file *, loff_t, int))0xffffffffffffffff,'

The "fop_flags" is a recent addition to the struct file_operations in
commit 210a03c9d51a ("fs: claw back a few FMODE_* bits")

This patch changes the test_btf_dump_struct_data() to reflect
this change.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/btf_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
index e9ea38aa8248..09a8e6f9b379 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
@@ -653,7 +653,7 @@ static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d,
 		cmpstr =
 "(struct file_operations){\n"
 "	.owner = (struct module *)0xffffffffffffffff,\n"
-"	.llseek = (loff_t (*)(struct file *, loff_t, int))0xffffffffffffffff,";
+"	.fop_flags = (fop_flags_t)4294967295,";
 
 		ASSERT_STRNEQ(str, cmpstr, strlen(cmpstr), "file_operations");
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
  2024-05-16 16:43 [PATCH bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations Martin KaFai Lau
@ 2024-05-16 16:54 ` Alan Maguire
  2024-05-17  0:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Maguire @ 2024-05-16 16:54 UTC (permalink / raw)
  To: Martin KaFai Lau, bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team

On 16/05/2024 17:43, Martin KaFai Lau wrote:
> From: Martin KaFai Lau <martin.lau@kernel.org>
> 
> The btf_dump test fails:
> 
> test_btf_dump_struct_data:FAIL:file_operations unexpected file_operations: actual '(struct file_operations){
> 	.owner = (struct module *)0xffffffffffffffff,
> 	.fop_flags = (fop_flags_t)4294967295,
> 	.llseek = (loff_t (*)(struct f' != expected '(struct file_operations){
> 	.owner = (struct module *)0xffffffffffffffff,
> 	.llseek = (loff_t (*)(struct file *, loff_t, int))0xffffffffffffffff,'
> 
> The "fop_flags" is a recent addition to the struct file_operations in
> commit 210a03c9d51a ("fs: claw back a few FMODE_* bits")
> 
> This patch changes the test_btf_dump_struct_data() to reflect
> this change.
> 
> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>

Reviewed-by: Alan Maguire <alan.maguire@oracle.com>

Thanks for updating this!

> ---
>  tools/testing/selftests/bpf/prog_tests/btf_dump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> index e9ea38aa8248..09a8e6f9b379 100644
> --- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> +++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
> @@ -653,7 +653,7 @@ static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d,
>  		cmpstr =
>  "(struct file_operations){\n"
>  "	.owner = (struct module *)0xffffffffffffffff,\n"
> -"	.llseek = (loff_t (*)(struct file *, loff_t, int))0xffffffffffffffff,";
> +"	.fop_flags = (fop_flags_t)4294967295,";
>  
>  		ASSERT_STRNEQ(str, cmpstr, strlen(cmpstr), "file_operations");
>  	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
  2024-05-16 16:43 [PATCH bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations Martin KaFai Lau
  2024-05-16 16:54 ` Alan Maguire
@ 2024-05-17  0:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-17  0:00 UTC (permalink / raw)
  To: Martin KaFai Lau; +Cc: bpf, ast, andrii, daniel, kernel-team

Hello:

This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Thu, 16 May 2024 09:43:10 -0700 you wrote:
> From: Martin KaFai Lau <martin.lau@kernel.org>
> 
> The btf_dump test fails:
> 
> test_btf_dump_struct_data:FAIL:file_operations unexpected file_operations: actual '(struct file_operations){
> 	.owner = (struct module *)0xffffffffffffffff,
> 	.fop_flags = (fop_flags_t)4294967295,
> 	.llseek = (loff_t (*)(struct f' != expected '(struct file_operations){
> 	.owner = (struct module *)0xffffffffffffffff,
> 	.llseek = (loff_t (*)(struct file *, loff_t, int))0xffffffffffffffff,'
> 
> [...]

Here is the summary with links:
  - [bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
    https://git.kernel.org/bpf/bpf/c/51e2b8d33199

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-17  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 16:43 [PATCH bpf] selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations Martin KaFai Lau
2024-05-16 16:54 ` Alan Maguire
2024-05-17  0:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.