Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 977bb324 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

net/smc: serialize connection creation in all cases



If a link group for a new server connection exists already, the mutex
serializing the determination of link groups is given up early.
The coming registration of memory regions benefits from the serialization
as well, if the mutex is held till connection creation is finished.
This patch postpones the unlocking of the link group creation mutex.

Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bdb0effc
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -779,11 +779,6 @@ static void smc_listen_work(struct work_struct *work)
	mutex_lock(&smc_create_lgr_pending);
	local_contact = smc_conn_create(new_smc, peeraddr.sin_addr.s_addr,
					smcibdev, ibport, &pclc.lcl, 0);
	if (local_contact == SMC_REUSE_CONTACT)
		/* lock no longer needed, free it due to following
		 * smc_clc_wait_msg() call
		 */
		mutex_unlock(&smc_create_lgr_pending);
	if (local_contact < 0) {
		rc = local_contact;
		if (rc == -ENOMEM)
@@ -853,7 +848,6 @@ static void smc_listen_work(struct work_struct *work)
	if (newsmcsk->sk_state == SMC_INIT)
		newsmcsk->sk_state = SMC_ACTIVE;
enqueue:
	if (local_contact == SMC_FIRST_CONTACT)
	mutex_unlock(&smc_create_lgr_pending);
	lock_sock_nested(&lsmc->sk, SINGLE_DEPTH_NESTING);
	if (lsmc->sk.sk_state == SMC_LISTEN) {