aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_sample.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-09-12 12:49:56 -0300
committerJason Gunthorpe <jgg@mellanox.com>2019-09-13 16:59:51 -0300
commit75c66515e4fea4e9bb488b6125e014220f846c61 (patch)
treea7a79ca9a05da74fd3fd74b1c8c3e1cb2901c167 /net/sched/act_sample.c
parentIB/iser: Support up to 16MB data transfer in a single command (diff)
parentLinux 5.3-rc8 (diff)
downloadlinux-dev-75c66515e4fea4e9bb488b6125e014220f846c61.tar.xz
linux-dev-75c66515e4fea4e9bb488b6125e014220f846c61.zip
Merge tag 'v5.3-rc8' into rdma.git for-next
To resolve dependencies in following patches mlx5_ib.h conflict resolved by keeing both hunks Linux 5.3-rc8 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'net/sched/act_sample.c')
-rw-r--r--net/sched/act_sample.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c
index 595308d60133..10229124a992 100644
--- a/net/sched/act_sample.c
+++ b/net/sched/act_sample.c
@@ -102,13 +102,17 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla,
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
s->rate = rate;
s->psample_group_num = psample_group_num;
- RCU_INIT_POINTER(s->psample_group, psample_group);
+ rcu_swap_protected(s->psample_group, psample_group,
+ lockdep_is_held(&s->tcf_lock));
if (tb[TCA_SAMPLE_TRUNC_SIZE]) {
s->truncate = true;
s->trunc_size = nla_get_u32(tb[TCA_SAMPLE_TRUNC_SIZE]);
}
spin_unlock_bh(&s->tcf_lock);
+
+ if (psample_group)
+ psample_group_put(psample_group);
if (goto_ch)
tcf_chain_put_by_act(goto_ch);
@@ -265,7 +269,7 @@ static __net_init int sample_init_net(struct net *net)
{
struct tc_action_net *tn = net_generic(net, sample_net_id);
- return tc_action_net_init(tn, &act_sample_ops);
+ return tc_action_net_init(net, tn, &act_sample_ops);
}
static void __net_exit sample_exit_net(struct list_head *net_list)