Re: [PATCH bpf] bpf: sockmap: add locking annotations to iterator

2020-10-14 Thread Jakub Sitnicki
On Mon, Oct 12, 2020 at 11:18 AM CEST, Lorenz Bauer wrote:
> The sparse checker currently outputs the following warnings:
>
> include/linux/rcupdate.h:632:9: sparse: sparse: context imbalance in 
> 'sock_hash_seq_start' - wrong count at exit
> include/linux/rcupdate.h:632:9: sparse: sparse: context imbalance in 
> 'sock_map_seq_start' - wrong count at exit
>
> Add the necessary __acquires and __release annotations to make the
> iterator locking schema palatable to sparse. Also add __must_hold
> for good measure.
>
> The kernel codebase uses both __acquires(rcu) and __acquires(RCU).
> I couldn't find any guidance which one is preferred, so I used
> what is easier to type out.
>
> Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash")
> Reported-by: kernel test robot 
> Signed-off-by: Lorenz Bauer 
> ---

Acked-by: Jakub Sitnicki 


RE: [PATCH bpf] bpf: sockmap: add locking annotations to iterator

2020-10-12 Thread John Fastabend
Lorenz Bauer wrote:
> The sparse checker currently outputs the following warnings:
> 
> include/linux/rcupdate.h:632:9: sparse: sparse: context imbalance in 
> 'sock_hash_seq_start' - wrong count at exit
> include/linux/rcupdate.h:632:9: sparse: sparse: context imbalance in 
> 'sock_map_seq_start' - wrong count at exit
> 
> Add the necessary __acquires and __release annotations to make the
> iterator locking schema palatable to sparse. Also add __must_hold
> for good measure.
> 
> The kernel codebase uses both __acquires(rcu) and __acquires(RCU).
> I couldn't find any guidance which one is preferred, so I used
> what is easier to type out.
> 
> Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash")
> Reported-by: kernel test robot 
> Signed-off-by: Lorenz Bauer 
> ---

LGTM

Acked-by: John Fastabend