Reset map info before each query in the existing show and dump loops to prevent BTF metadata from a preceding map leaking into a map without BTF.
Patch 1 fixes the four query loops. Patch 2 adds regression tests for full and named listings, JSON dumps, and plain dumps. All four regression subtests fail on the unmodified bpf-next base and pass with the fix in an x86-64 VM. This series does not depend on recursive dumping or Maxim's series. Tianyi Chen (2): bpftool: Reset map info before each query in show and dump loops selftests/bpf: Check bpftool map info across mixed BTF maps tools/bpf/bpftool/map.c | 8 ++ .../bpf/prog_tests/bpftool_map_info.c | 126 ++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests/bpftool_map_info.c base-commit: ea9358e1270ab2c3ba6f36bd9bdda68617665516 -- 2.55.0
