[ovs-dev] [PATCH v2 03/13] datapath: Fix race.

Jarno Rajahalme jrajahalme at nicira.com
Thu Feb 13 21:24:33 UTC 2014


Thanks for the review.

Pushed to master, 2.1, 2.0, 1.11, 1.10, and 1.9,

  Jarno

On Feb 12, 2014, at 3:35 PM, Pravin Shelar <pshelar at nicira.com> wrote:

> On Tue, Feb 11, 2014 at 4:07 PM, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>> ovs_vport_cmd_dump() did rcu_read_lock() only after getting the
>> datapath, which could have been deleted in between.  Resolved by
>> taking rcu_read_lock() before the get_dp() call.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
> Looks good.
> 
> Acked-by: Pravin B Shelar <pshelar at nicira.com>
> 
> Thanks.
> 
>> ---
>> v2: No change
>> 
>> datapath/datapath.c |    7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>> 
>> diff --git a/datapath/datapath.c b/datapath/datapath.c
>> index 289fabb..c423894 100644
>> --- a/datapath/datapath.c
>> +++ b/datapath/datapath.c
>> @@ -1766,11 +1766,12 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
>>        int bucket = cb->args[0], skip = cb->args[1];
>>        int i, j = 0;
>> 
>> +       rcu_read_lock();
>>        dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
>> -       if (!dp)
>> +       if (!dp) {
>> +               rcu_read_unlock();
>>                return -ENODEV;
>> -
>> -       rcu_read_lock();
>> +       }
>>        for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) {
>>                struct vport *vport;
>> 
>> --
>> 1.7.10.4
>> 
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list