Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLPX-93447 test_estat_subcommands failed to run estat zvol command with compilation error #102

Conversation

palash-gandhi
Copy link

@palash-gandhi palash-gandhi commented Feb 24, 2025

Problem

The estat zvol command fails on 24.04 with:

10:54:26  dlpx-os-upgrade-qar-163491-766f97e2.dcol2.delphix.com: Error executing command "sudo -- timeout --preserve-status --signal=SIGINT 30 estat zvol 15". Code: 1. Error: In file included from /virtual/main.c:64:
10:54:26  /usr/src/zfs-6.8.0-47-dx2025012303-436f4ae50-generic/include/sys/zvol_impl.h:91:22: error: unknown type name 'zvol_state_handle_t'; did you mean 'depot_stack_handle_t'?
10:54:26     91 | int zvol_clone_range(zvol_state_handle_t *, uint64_t,
10:54:26        |                      ^~~~~~~~~~~~~~~~~~~
10:54:26        |                      depot_stack_handle_t
10:54:26  include/linux/stackdepot.h:25:13: note: 'depot_stack_handle_t' declared here
10:54:26     25 | typedef u32 depot_stack_handle_t;
10:54:26        |             ^
10:54:26  In file included from /virtual/main.c:64:
10:54:26  /usr/src/zfs-6.8.0-47-dx2025012303-436f4ae50-generic/include/sys/zvol_impl.h:92:5: error: unknown type name 'zvol_state_handle_t'; did you mean 'depot_stack_handle_t'?
10:54:26     92 |     zvol_state_handle_t *, uint64_t, uint64_t);
10:54:26        |     ^~~~~~~~~~~~~~~~~~~
10:54:26        |     depot_stack_handle_t
10:54:26  include/linux/stackdepot.h:25:13: note: 'depot_stack_handle_t' declared here
10:54:26     25 | typedef u32 depot_stack_handle_t;
10:54:26        |             ^
10:54:26  2 errors generated.
10:54:26  Traceback (most recent call last):
10:54:26    File "/usr/bin/estat", line 413, in <module>
10:54:26      b = BPF(text=bpf_text, cflags=cflags, debug=debug_level)
10:54:26          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:54:26    File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 479, in __init__
10:54:26      raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))

The problem is a missing include directive in zvol_impl.h. openzfs/zfs@9dd5fe1
caused this.
zvol_state_handle_t is declared in sys/zvol.h which is not included in zvol_impl.h.

Solution

There were 2 fixes: include zvol.h in zvol_impl.h or do what upstream does, include zvol.h whenever including zvol_impl.h. This is likely why upstream doesn't see this issue. As such, I chose the latter here but have tested both fixes.

Testing Done

ab-pre-push: https://selfservice-jenkins.eng-tools-prd.aws.delphixcloud.com/job/appliance-build-orchestrator-pre-push/10452/

delphix@ip-10-110-202-51:~$ sudo estat zvol 15
02/24/25 - 16:33:27 UTC

 Tracing enabled... Hit Ctrl-C to end.

@palash-gandhi palash-gandhi force-pushed the dlpx/pr/palash-gandhi/1654b768-345e-4cc4-badb-a27b773553f9 branch from e7e0e91 to 3595f0f Compare February 24, 2025 16:34
@palash-gandhi palash-gandhi marked this pull request as ready for review February 24, 2025 16:38
@palash-gandhi palash-gandhi merged commit 7aea614 into os-upgrade Feb 24, 2025
6 of 7 checks passed
@palash-gandhi palash-gandhi deleted the dlpx/pr/palash-gandhi/1654b768-345e-4cc4-badb-a27b773553f9 branch February 24, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants