Subject: Re: [PATCH] sctp: lock_sock_nested in sctp_sock_migrate

From: Vlad Yasevich <[email-masked]>
Date: Mon, 25 Jun 2007 16:38:20 -0400

Arjan van de Ven wrote:
> Vlad Yasevich wrote:
>> Hm... This is another case of of two different sockets taking the same
>> lock...
>>
>> Arjan,  did this every get fixed, or is the nested locking the right
>> solution
>> to this?
>>
> 
> for this specific case it's ok and the nested solution is right.
> In the general case it's obviously not safe to take the locks of two
> sockets in "unspecified" order....
> 

Well, in this case the order is very carefully specified, but I was more
interested in what the right solution is.

The newsk, from the patch, has just been created, but needs to be locked
to prevent soft_irq from queuing packets to it while we are mucking around.
This is the same case as the accept case that had issues some time ago.

-vlad