Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: Karsten Graul <kgraul@linux.ibm.com>,
	davem@davemloft.net, kuba@kernel.org
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/3] net/smc: Resolve the race between link group access and termination
Date: Mon, 10 Jan 2022 21:56:05 +0800	[thread overview]
Message-ID: <2098bb01-1aad-cb38-8b0b-a43e4c40c013@linux.alibaba.com> (raw)
In-Reply-To: <3525a4cd-1bc7-1008-910b-fb89597cc10a@linux.ibm.com>



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

  reply	other threads:[~2022-01-10 13:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  9:26 [PATCH net 0/3] net/smc: Fixes for race in smc link group termination Wen Gu
2022-01-10  9:26 ` [PATCH net 1/3] net/smc: Resolve the race between link group access and termination Wen Gu
2022-01-10 12:25   ` Karsten Graul
2022-01-10 13:56     ` Wen Gu [this message]
2022-01-11  8:23   ` Karsten Graul
2022-01-11 15:36     ` Wen Gu
2022-01-11 15:46       ` Karsten Graul
2022-01-11 15:51         ` Wen Gu
2022-01-10  9:26 ` [PATCH net 2/3] net/smc: Introduce a new conn->lgr validity check helper Wen Gu
2022-01-10  9:26 ` [PATCH net 3/3] net/smc: Resolve the race between SMC-R link access and clear Wen Gu
2022-01-11  8:40   ` Karsten Graul
2022-01-11 15:49     ` Wen Gu
2022-01-11 16:02       ` Karsten Graul
2022-01-11 16:44         ` Wen Gu
2022-01-11 17:42           ` Karsten Graul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2098bb01-1aad-cb38-8b0b-a43e4c40c013@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH net 1/3] net/smc: Resolve the race between link group access and termination' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).