projects
/
platform
/
kernel
/
linux-rpi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perf tools: Fix calloc() arguments to address error introduced in gcc-14
[platform/kernel/linux-rpi.git]
/
kernel
/
bpf
/
map_in_map.c
diff --git
a/kernel/bpf/map_in_map.c
b/kernel/bpf/map_in_map.c
index
cd5eafa
..
3248ff5
100644
(file)
--- a/
kernel/bpf/map_in_map.c
+++ b/
kernel/bpf/map_in_map.c
@@
-127,12
+127,17
@@
void *bpf_map_fd_get_ptr(struct bpf_map *map,
return inner_map;
}
return inner_map;
}
-void bpf_map_fd_put_ptr(
void *pt
r)
+void bpf_map_fd_put_ptr(
struct bpf_map *map, void *ptr, bool need_defe
r)
{
{
- /* ptr->ops->map_free() has to go through one
- * rcu grace period by itself.
+ struct bpf_map *inner_map = ptr;
+
+ /* The inner map may still be used by both non-sleepable and sleepable
+ * bpf program, so free it after one RCU grace period and one tasks
+ * trace RCU grace period.
*/
*/
- bpf_map_put(ptr);
+ if (need_defer)
+ WRITE_ONCE(inner_map->free_after_mult_rcu_gp, true);
+ bpf_map_put(inner_map);
}
u32 bpf_map_fd_sys_lookup_elem(void *ptr)
}
u32 bpf_map_fd_sys_lookup_elem(void *ptr)