[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2098bb01-1aad-cb38-8b0b-a43e4c40c013@linux.alibaba.com>
Date: Mon, 10 Jan 2022 21:56:05 +0800
From: Wen Gu <guwen@...ux.alibaba.com>
To: Karsten Graul <kgraul@...ux.ibm.com>, davem@...emloft.net,
kuba@...nel.org
Cc: linux-s390@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 1/3] net/smc: Resolve the race between link group
access and termination
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
Powered by blists - more mailing lists