bpf: bpf_task_storage_delete_recur does lookup first before the deadlock check
authorMartin KaFai Lau <martin.lau@kernel.org>
Tue, 25 Oct 2022 18:45:21 +0000 (11:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Oct 2022 06:11:46 +0000 (23:11 -0700)
commitfda64ae0bb3e37b5a4292625c6931cb156224d0f
tree27fa66933685435b9a643e29b0fb0c9aa3b4c14a
parent4279adb094a17132423f1271c3d11b593fc2327e
bpf: bpf_task_storage_delete_recur does lookup first before the deadlock check

Similar to the earlier change in bpf_task_storage_get_recur.
This patch changes bpf_task_storage_delete_recur such that it
does the lookup first.  It only returns -EBUSY if it needs to
take the spinlock to do the deletion when potential deadlock
is detected.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20221025184524.3526117-7-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/bpf_task_storage.c