From: Karsten Graul <kgraul@linux.ibm.com>
To: liuyacan@corp.netease.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
netdev@vger.kernel.org, pabeni@redhat.com, ubraun@linux.ibm.com
Subject: Re: [PATCH net] net/smc: fix listen processing for SMC-Rv2
Date: Mon, 23 May 2022 14:37:46 +0200 [thread overview]
Message-ID: <f35924c0-4691-3b11-c302-9d79f3e3c1c7@linux.ibm.com> (raw)
In-Reply-To: <20220523121245.1910773-1-liuyacan@corp.netease.com>
On 23/05/2022 14:12, liuyacan@corp.netease.com wrote:
>>> From: liuyacan <liuyacan@corp.netease.com>
>>>
>>> In the process of checking whether RDMAv2 is available, the current
>>> implementation first sets ini->smcrv2.ib_dev_v2, and then allocates
>>> smc buf desc, but the latter may fail. Unfortunately, the caller
>>> will only check the former. In this case, a NULL pointer reference
>>> will occur in smc_clc_send_confirm_accept() when accessing
>>> conn->rmb_desc.
>>>
>>> This patch does two things:
>>> 1. Use the return code to determine whether V2 is available.
>>> 2. If the return code is NODEV, continue to check whether V1 is
>>> available.
>>>
>>> Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2")
>>> Signed-off-by: liuyacan <liuyacan@corp.netease.com>
>>> ---
>>
>> I am not happy with this patch. You are right that this is a problem,
>> but the fix should be much simpler: set ini->smcrv2.ib_dev_v2 = NULL in
>> smc_find_rdma_v2_device_serv() after the not_found label, just like it is
>> done in a similar way for the ISM device in smc_find_ism_v1_device_serv().
>>
>> Your patch changes many more things, and beside that you eliminated the calls
>> to smc_find_ism_store_rc() completely, which is not correct.
>>
>> Since your patch was already applied (btw. 3:20 hours after you submitted it),
>> please revert it and resend. Thank you.
>
> I also have considered this way, one question is that do we need to do more roll
> back work before V1 check?
>
> Specifically, In smc_find_rdma_v2_device_serv(), there are the following steps:
>
> 1. smc_listen_rdma_init()
> 1.1 smc_conn_create()
> 1.2 smc_buf_create() --> may fail
> 2. smc_listen_rdma_reg() --> may fail
>
> When later steps fail, Do we need to roll back previous steps?
That is a good question and I think that is a different problem for another patch.
smc_listen_rdma_init() maybe should call smc_conn_abort() similar to what smc_listen_ism_init()
does in this situation. And when smc_listen_rdma_reg() fails ... hmm we need to think about this.
We will also discuss this here in our team.
next prev parent reply other threads:[~2022-05-23 12:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 5:50 [PATCH net] net/smc: fix listen processing for SMC-Rv2 liuyacan
2022-05-23 9:10 ` patchwork-bot+netdevbpf
2022-05-23 11:19 ` Karsten Graul
2022-05-23 12:12 ` liuyacan
2022-05-23 12:37 ` Karsten Graul [this message]
2022-05-23 13:25 ` liuyacan
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=f35924c0-4691-3b11-c302-9d79f3e3c1c7@linux.ibm.com \
--to=kgraul@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=liuyacan@corp.netease.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ubraun@linux.ibm.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).