Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: Make symbol 'bpf_task_storage_busy' static

The sparse tool complains as follows:

kernel/bpf/bpf_task_storage.c:23:1: warning:
symbol '__pcpu_scope_bpf_task_storage_busy' was not declared. Should it be static?

This symbol is not used outside of bpf_task_storage.c, so this
commit marks it static.

Fixes: bc235cdb423a ("bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete]")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210311131505.1901509-1-weiyongjun1@huawei.com

authored by

Wei Yongjun and committed by
Alexei Starovoitov
4d0b9389 6bd45f2e

+1 -1
+1 -1
kernel/bpf/bpf_task_storage.c
··· 20 20 21 21 DEFINE_BPF_STORAGE_CACHE(task_cache); 22 22 23 - DEFINE_PER_CPU(int, bpf_task_storage_busy); 23 + static DEFINE_PER_CPU(int, bpf_task_storage_busy); 24 24 25 25 static void bpf_task_storage_lock(void) 26 26 {