lkml.org 
[lkml]   [2022]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net 1/3] net/smc: Resolve the race between link group access and termination
From


On 2022/1/10 8:25 pm, Karsten Graul wrote:
> On 10/01/2022 10:26, Wen Gu wrote:
>> We encountered some crashes caused by the race between the access
>> and the termination of link groups.
>>

>> @@ -1120,8 +1122,22 @@ void smc_conn_free(struct smc_connection *conn)
>> {
>> struct smc_link_group *lgr = conn->lgr;
>>
>> - if (!lgr)
>> + if (!lgr || conn->freed)
>> + /* The connection has never been registered in a
>> + * link group, or has already been freed.
>> + *
>> + * Check to ensure that the refcnt of link group
>> + * won't be put incorrectly.
>
> I would delete the second sentence here, its obvious enough.
>
>> + */
>> return;
>> +
>> + conn->freed = 1;
>> + if (!conn->alert_token_local)
>> + /* The connection was registered in a link group
>> + * defore, but now it is unregistered from it.
>
> 'before' ... But would maybe the following be more exact:
>
> 'Connection already unregistered from link group.'
>
>
> We still review the patches...
>

Thanks for your detailed and patient review. The comments will
be improved as you suggested.

Thanks,
Wen Gu

\
 
 \ /
  Last update: 2022-01-10 14:57    [W:0.400 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site