[CRIU] [PATCH 2/2] tcp: refresh a data about tcp connection after blocking it (v4)

Pavel Emelyanov xemul at parallels.com
Fri Nov 16 08:29:39 EST 2012


On 11/16/2012 03:41 PM, Andrew Vagin wrote:
> On Fri, Nov 16, 2012 at 03:02:22PM +0400, Pavel Emelyanov wrote:
>>>  static int tcp_repair_establised(int fd, struct inet_sk_desc *sk)
>>>  {
>>>  	int ret;
>>> @@ -298,6 +330,21 @@ int dump_one_tcp(int fd, struct inet_sk_desc *sk)
>>>  		ret = nf_lock_connection(sk);
>>>  		if (ret < 0)
>>>  			return -1;
>>> +
>>> +		/* A state of a tcp connection could be changed */
>>> +		ret = refresh_inet_sk(fd, sk);
>>> +		if (ret < 0)
>>> +			goto err;
>>> +
>>> +		if (sk->state == TCP_CLOSE) {
>>
>> Socket cant change state from established to closed w/o task's will.
> 
> Look at tcp_done(sk). It's called from 
> tcp_keepalive_timer,

Called for FIN_WAIT2 state, not established.

> tcp_write_timeout, 

Not called directly, what's the calltrace?

> etc.

?

>>
>>> +			nf_unlock_connection(sk);
>>> +			return 0;
>>> +		}
>>> +
>>> +		if (sk->state != TCP_ESTABLISHED) {
>>> +			pr_err("Unknown state %d\n", sk->state);
>>> +			goto err;
>>> +		}
>>>  	}
>>>  
>>>  	pr_info("Dumping TCP connection\n");
>>>
>>
>>
> .
> 




More information about the CRIU mailing list