Re: [PATCH v4 0/2] tools/bpf/bpftool: Fix vmlinux BTF state cleanup
From: Quentin Monnet
Date: Wed Jul 01 2026 - 09:42:36 EST
2026-06-24 10:50 UTC+0800 ~ Yichong Chen <chenyichong@xxxxxxxxxxxxx>
> This series fixes stale vmlinux BTF state in bpftool batch mode.
>
> Patch 1 resets the map command cached vmlinux BTF pointer when the
> command releases it, and avoids freeing the cached object from the
> map lookup path.
>
> Patch 2 resets the struct_ops command cached vmlinux BTF pointer and
> dependent cached map info state after each struct_ops command.
>
> Changes in v4:
> - Add Emil's Reviewed-by tag to patch 1.
> - Inline the struct_ops cleanup instead of adding a helper.
>
> Changes in v3:
> - Add Fixes tags to both patches.
>
> Changes in v2:
> - Fold the map lookup path fix into patch 1.
> - Update patch 1 subject and commit message to cover map commands
> rather than only map dump.
>
> Yichong Chen (2):
> tools/bpf/bpftool: Reset vmlinux BTF after map commands
> tools/bpf/bpftool: Reset vmlinux BTF after struct_ops commands
>
> tools/bpf/bpftool/map.c | 12 +++++++++---
> tools/bpf/bpftool/struct_ops.c | 4 ++++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
Both patches look good, thank you for following up with these fixes!
Reviewed-by: Quentin Monnet <qmo@xxxxxxxxxx>