Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The compiler is optimizing out majority of unref_ptr read/writes, so the test wasn't testing much. For example, one could delete '__kptr' tag from 'struct prog_test_ref_kfunc __kptr *unref_ptr;' and the test would still "pass". Convert it to volatile stores. Confirmed by comparing bpf asm before/after. Fixes: 2cbc469 ("selftests/bpf: Add C tests for kptr") Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Stanislav Fomichev <[email protected]> Acked-by: Kumar Kartikeya Dwivedi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
- Loading branch information