[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170217.151907.1987368624831286456.davem@davemloft.net>
Date: Fri, 17 Feb 2017 15:19:07 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: lucien.xin@...il.com
Cc: netdev@...r.kernel.org, linux-sctp@...r.kernel.org,
marcelo.leitner@...il.com, nhorman@...driver.com,
vyasevich@...il.com
Subject: Re: [PATCH net] sctp: check duplicate node before inserting a new
transport
From: Xin Long <lucien.xin@...il.com>
Date: Fri, 17 Feb 2017 16:35:24 +0800
> + list = rhltable_lookup(&sctp_transport_hashtable, &arg,
> + sctp_hash_params);
> +
> + rhl_for_each_entry_rcu(transport, tmp, list, node)
> + if (transport->asoc->ep == t->asoc->ep) {
> + err = -EEXIST;
> + goto out;
> + }
> +
> err = rhltable_insert_key(&sctp_transport_hashtable, &arg,
> &t->node, sctp_hash_params);
> +
> +out:
Well, what if another thread of control inserts a matching transport
after you've checked the list but before rhltable_insert_key() does
it's work?
What write side lock is being held to protect the table from
modifications here?
Powered by blists - more mailing lists