lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241130082630.2007-1-liqiang64@huawei.com>
Date: Sat, 30 Nov 2024 16:26:30 +0800
From: liqiang <liqiang64@...wei.com>
To: <wenjia@...ux.ibm.com>, <jaka@...ux.ibm.com>, <alibuda@...ux.alibaba.com>,
	<tonylu@...ux.alibaba.com>, <guwen@...ux.alibaba.com>
CC: <linux-s390@...r.kernel.org>, <netdev@...r.kernel.org>,
	<luanjianhai@...wei.com>, <zhangxuzhou4@...wei.com>,
	<dengguangxing@...wei.com>, <gaochao24@...wei.com>, <liqiang64@...wei.com>
Subject: [PATCH net-next] net/smc: Optimize the timing of unlocking in smc_listen_work

The optimized code is equivalent to the original process, and it releases the
lock early.

Signed-off-by: liqiang <liqiang64@...wei.com>
---
 net/smc/af_smc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 9d76e902fd77..7fa80be1ea93 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -2526,9 +2526,9 @@ static void smc_listen_work(struct work_struct *work)
 	if (!ini->is_smcd) {
 		rc = smc_listen_rdma_finish(new_smc, cclc,
 					    ini->first_contact_local, ini);
-		if (rc)
-			goto out_unlock;
 		mutex_unlock(&smc_server_lgr_pending);
+		if (rc)
+			goto out_decl;
 	}
 	smc_conn_save_peer_info(new_smc, cclc);
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ