smc_llc_cli_rkey_exchange() checks what smc_llc_add_link_cont() returns
and leaves the loop when the send fails:
rc = smc_llc_add_link_cont(link, link_new, &num_rkeys_send,
&buf_lst, &buf_pos);
if (rc)
break;
smc_llc_srv_rkey_exchange() discards it and goes on to wait for a reply
to a message that was never transmitted, so the round can only end in
the wait timing out. Make the server side behave like the client side.
This is independent of the bounding in the previous patch and can be
dropped or deferred without affecting it.
This patch was written with the help of an AI coding assistant (Claude).
Fixes: 57b499242cb8 ("net/smc: rkey processing for a new link as SMC
server")
Signed-off-by: Ermenson Junior <erme…@gmail.com>
---
net/smc/smc_llc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index 818dd84e720f..e41011d19b73 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -1400,8 +1400,10 @@ static int smc_llc_srv_rkey_exchange(struct smc_link *link,
if (timeo > SMC_LLC_WAIT_TIME)
timeo = SMC_LLC_WAIT_TIME;
- smc_llc_add_link_cont(link, link_new, &num_rkeys_send,
- &buf_lst, &buf_pos);
+ rc = smc_llc_add_link_cont(link, link_new, &num_rkeys_send,
+ &buf_lst, &buf_pos);
+ if (rc)
+ goto out;
qentry = smc_llc_wait(lgr, link, timeo, SMC_LLC_ADD_LINK_CONT);
if (!qentry) {
rc = -ETIMEDOUT;
--
2.43.0