Commit f00f2f7f authored by Alexei Starovoitov's avatar Alexei Starovoitov

Revert "bpf: Fix potential call bpf_link_free() in atomic context"

This reverts commit 31f23a6a.

This change made many selftests/bpf flaky: flow_dissector, sk_lookup, sk_assign and others.
There was no issue in the code.
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 3fc826f1
...@@ -2345,8 +2345,12 @@ void bpf_link_put(struct bpf_link *link) ...@@ -2345,8 +2345,12 @@ void bpf_link_put(struct bpf_link *link)
if (!atomic64_dec_and_test(&link->refcnt)) if (!atomic64_dec_and_test(&link->refcnt))
return; return;
INIT_WORK(&link->work, bpf_link_put_deferred); if (in_atomic()) {
schedule_work(&link->work); INIT_WORK(&link->work, bpf_link_put_deferred);
schedule_work(&link->work);
} else {
bpf_link_free(link);
}
} }
static int bpf_link_release(struct inode *inode, struct file *filp) static int bpf_link_release(struct inode *inode, struct file *filp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment