diff mbox series

[net-next] net/smc: Optimize the timing of unlocking in smc_listen_work

Message ID 20241130082630.2007-1-liqiang64@huawei.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/smc: Optimize the timing of unlocking in smc_listen_work | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 5 maintainers not CCed: kuba@kernel.org linux-rdma@vger.kernel.org horms@kernel.org pabeni@redhat.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 304 this patch: 304
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-11-30--09-00 (tests: 761)

Commit Message

liqiang Nov. 30, 2024, 8:26 a.m. UTC
The optimized code is equivalent to the original process, and it releases the
lock early.

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

Patch

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);