Re: [PATCH 01/22] netfilter: ipset: Correct rcu_dereference_bh_nfnl() usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 23, 2016 at 10:37:34PM +0200, Jozsef Kadlecsik wrote:
> When rcu_dereference_bh_nfnl() macro would be defined on the target
> system it will accept pointer and subsystem id.
> 
> Check if rcu_dereference_bh_nfnl() is defined and make it accepting two
> arguments.
> 
> Ported from a patch proposed by Sergey Popovich <popovich_sergei@xxxxxxx>.
> 
> Suggested-by: Sergey Popovich <popovich_sergei@xxxxxxx>
> Signed-off-by: Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx>
> ---
>  net/netfilter/ipset/ip_set_hash_gen.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
> index d32fd6b..bc54be4 100644
> --- a/net/netfilter/ipset/ip_set_hash_gen.h
> +++ b/net/netfilter/ipset/ip_set_hash_gen.h
> @@ -17,7 +17,9 @@
>  #define ipset_dereference_protected(p, set) \
>  	__ipset_dereference_protected(p, spin_is_locked(&(set)->lock))
>  
> -#define rcu_dereference_bh_nfnl(p)	rcu_dereference_bh_check(p, 1)
> +#ifndef rcu_dereference_bh_nfnl

Why this new ifndef? I guess this has to be with the ipset bundle that
you release as standalone module.

> +#define rcu_dereference_bh_nfnl(p, ss)	rcu_dereference_bh_check(p, 1)

If you add this new subsystem parameter, then I think it makes sense
to use lockdep_nfnl_is_held() here. Otherwise, passing the subsystem
ID is not useful.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux