All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] bonding: restrict the data protected by rcu_read_lock
@ 2016-07-12  7:28 Zhu Yanjun
  2016-07-12 18:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhu Yanjun @ 2016-07-12  7:28 UTC (permalink / raw)
  To: netdev; +Cc: Zhu Yanjun, Jay Vosburgh

In this function, origin is a pointer to struct aggregator.
No matter what agg is changed to, it has nothing to do with origin.

CC: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Zhu Yanjun <zyjzyj2000@gmail.com>
---
 drivers/net/bonding/bond_3ad.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index edc70ff..20afee3 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1624,8 +1624,8 @@ static void ad_agg_selection_logic(struct aggregator *agg,
 	struct slave *slave;
 	struct port *port;
 
-	rcu_read_lock();
 	origin = agg;
+	rcu_read_lock();
 	active = __get_active_agg(agg);
 	best = (active && agg_device_up(active)) ? active : NULL;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] bonding: restrict the data protected by rcu_read_lock
  2016-07-12  7:28 [PATCH 1/1] bonding: restrict the data protected by rcu_read_lock Zhu Yanjun
@ 2016-07-12 18:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-12 18:03 UTC (permalink / raw)
  To: zyjzyj2000; +Cc: netdev, jay.vosburgh

From: Zhu Yanjun <zyjzyj2000@gmail.com>
Date: Tue, 12 Jul 2016 15:28:17 +0800

> In this function, origin is a pointer to struct aggregator.
> No matter what agg is changed to, it has nothing to do with origin.
> 
> CC: Jay Vosburgh <jay.vosburgh@canonical.com>
> Signed-off-by: Zhu Yanjun <zyjzyj2000@gmail.com>

I really hate changes like this.

Imagine if a inner function was called with RCU protection around
it, as a rule.

That's the same as what is happening here, the RCU locking is done
around the entire contents of the function and that is perfectly
fine even if one variable assignment or whatever is superfluously
contained inside of it.

I'm not applying this patch, sorry.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-12 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12  7:28 [PATCH 1/1] bonding: restrict the data protected by rcu_read_lock Zhu Yanjun
2016-07-12 18:03 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.