Subject: Re: [PATCH net-next-2.6] tcp: connect() race with timewait reuse

From: Evgeniy Polyakov <[email-masked]>
Date: Thu, 3 Dec 2009 01:15:53 +0300

Hi.

Looks very good, thanks Eric, I have one question.

On Wed, Dec 02, 2009 at 04:08:59PM +0100, Eric Dumazet ([email-masked]) wrote:
> +
> +/*
> + * unhash a timewait socket from established hash
> + * lock must be hold by caller
> + */
> +void inet_twsk_unhash(struct inet_timewait_sock *tw)
> +{
> +	if (hlist_nulls_unhashed(&tw->tw_node))
> +		return;
> +
> +	hlist_nulls_del_rcu(&tw->tw_node);
> +	sk_nulls_node_init(&tw->tw_node);
> +	inet_twsk_put(tw);

Is it safe to call in locked context? inet_twsk_put() schedules
preemption, also I did not check what tw destructor does.

-- 
	Evgeniy Polyakov