summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-06-20 05:32:00 +0000
committerDavid S. Miller <davem@davemloft.net>2012-06-20 14:04:10 -0700
commitb443a2307d3ade1520daa15d79ef97ad00641504 (patch)
tree28a35122ade392cc700a6fec361f7bf8b45f88c1
parent1aa2d1daf067c8c9e625449e2e6f54caa3e34023 (diff)
team: use rcu_access_pointer to access RCU pointer by writer
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/team/team_mode_activebackup.c7
-rw-r--r--drivers/net/team/team_mode_loadbalance.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
index 2fe02a8713ea..c9e7621b4480 100644
--- a/drivers/net/team/team_mode_activebackup.c
+++ b/drivers/net/team/team_mode_activebackup.c
@@ -61,8 +61,11 @@ static void ab_port_leave(struct team *team, struct team_port *port)
static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx)
{
- if (ab_priv(team)->active_port)
- ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex;
+ struct team_port *active_port;
+
+ active_port = rcu_access_pointer(ab_priv(team)->active_port);
+ if (active_port)
+ ctx->data.u32_val = active_port->dev->ifindex;
else
ctx->data.u32_val = 0;
return 0;
diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
index 45cc0951aa48..b4475a5d2d4b 100644
--- a/drivers/net/team/team_mode_loadbalance.c
+++ b/drivers/net/team/team_mode_loadbalance.c
@@ -96,7 +96,7 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
struct lb_port_mapping *pm;
pm = &lb_priv->ex->tx_hash_to_port_mapping[i];
- if (pm->port == port) {
+ if (rcu_access_pointer(pm->port) == port) {
rcu_assign_pointer(pm->port, NULL);
team_option_inst_set_change(pm->opt_inst_info);
changed = true;
@@ -292,7 +292,7 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
if (lb_priv->ex->orig_fprog) {
/* Clear old filter data */
__fprog_destroy(lb_priv->ex->orig_fprog);
- sk_unattached_filter_destroy(lb_priv->fp);
+ sk_unattached_filter_destroy(rcu_access_pointer(lb_priv->fp));
}
rcu_assign_pointer(lb_priv->fp, fp);
@@ -303,9 +303,11 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
static int lb_tx_method_get(struct team *team, struct team_gsetter_ctx *ctx)
{
struct lb_priv *lb_priv = get_lb_priv(team);
+ lb_select_tx_port_func_t *func;
char *name;
- name = lb_select_tx_port_get_name(lb_priv->select_tx_port_func);
+ func = rcu_access_pointer(lb_priv->select_tx_port_func);
+ name = lb_select_tx_port_get_name(func);
BUG_ON(!name);
ctx->data.str_val = name;
return 0;