All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karsten Graul <kgraul@linux.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	heiko.carstens@de.ibm.com, raspl@linux.ibm.com,
	ubraun@linux.ibm.com
Subject: [PATCH net v2 02/10] net/smc: clear link during SMC client link down processing
Date: Sat, 18 Jul 2020 15:06:10 +0200	[thread overview]
Message-ID: <20200718130618.16724-3-kgraul@linux.ibm.com> (raw)
In-Reply-To: <20200718130618.16724-1-kgraul@linux.ibm.com>

In a link-down condition we notify the SMC server and expect that the
server will finally trigger the link clear processing on the client
side. This could fail when anything along this notification path goes
wrong. Clear the link as part of SMC client link-down processing to
prevent dangling links.

Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Fixes: 541afa10c126 ("net/smc: add smcr_port_err() and smcr_link_down() processing")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
 net/smc/smc_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index f69d205b3e11..e286b3c8c962 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1204,10 +1204,12 @@ static void smcr_link_down(struct smc_link *lnk)
 				SMC_LLC_WAIT_TIME);
 			mutex_lock(&lgr->llc_conf_mutex);
 		}
-		if (!list_empty(&lgr->list))
+		if (!list_empty(&lgr->list)) {
 			smc_llc_send_delete_link(to_lnk, del_link_id,
 						 SMC_LLC_REQ, true,
 						 SMC_LLC_DEL_LOST_PATH);
+			smcr_link_clear(lnk, true);
+		}
 		wake_up(&lgr->llc_flow_waiter);	/* wake up next waiter */
 	}
 }
-- 
2.17.1


  parent reply	other threads:[~2020-07-18 13:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 13:06 [PATCH net v2 00/10] net/smc: fixes 2020-07-16 Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 01/10] net/smc: handle unexpected response types for confirm link Karsten Graul
2020-07-18 13:06 ` Karsten Graul [this message]
2020-07-18 13:06 ` [PATCH net v2 03/10] net/smc: fix link lookup for new rdma connections Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 04/10] net/smc: protect smc ib device initialization Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 05/10] net/smc: drop out-of-flow llc response messages Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 06/10] net/smc: move add link processing for new device into llc layer Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 07/10] net/smc: fix handling of delete link requests Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 08/10] net/smc: do not call dma sync for unmapped memory Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 09/10] net/smc: remove freed buffer from list Karsten Graul
2020-07-18 13:06 ` [PATCH net v2 10/10] net/smc: fix restoring of fallback changes Karsten Graul
2020-07-19 22:30 ` [PATCH net v2 00/10] net/smc: fixes 2020-07-16 David Miller

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=20200718130618.16724-3-kgraul@linux.ibm.com \
    --to=kgraul@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raspl@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.