Message ID | 20220831042629.130006-3-houtao@huaweicloud.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 66a7a92e4d0d091e79148a4c6ec15d1da65f4280 |
Delegated to: | BPF |
Headers | show |
Series | fixes for concurrent htab updates | expand |
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c index 6fb3b7fd1622..eb1263f03e9b 100644 --- a/kernel/bpf/hashtab.c +++ b/kernel/bpf/hashtab.c @@ -1704,8 +1704,11 @@ __htab_map_lookup_and_delete_batch(struct bpf_map *map, /* do not grab the lock unless need it (bucket_cnt > 0). */ if (locked) { ret = htab_lock_bucket(htab, b, batch, &flags); - if (ret) - goto next_batch; + if (ret) { + rcu_read_unlock(); + bpf_enable_instrumentation(); + goto after_loop; + } } bucket_cnt = 0;