Skip to content

Commit 0537f0a

Browse files
D-Wythedavem330
authored andcommitted
net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client
The main reason for this unexpected SMC_CLC_DECL_ERR_REGRMB in client dues to following execution sequence: Server Conn A: Server Conn B: Client Conn B: smc_lgr_unregister_conn smc_lgr_register_conn smc_clc_send_accept -> smc_rtoken_add smcr_buf_unuse -> Client Conn A: smc_rtoken_delete smc_lgr_unregister_conn() makes current link available to assigned to new incoming connection, while smcr_buf_unuse() has not executed yet, which means that smc_rtoken_add may fail because of insufficient rtoken_entry, reversing their execution order will avoid this problem. Fixes: 3e03472 ("net/smc: common functions for RMBs and send buffers") Signed-off-by: D. Wythe <alibuda@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bd6f1fd commit 0537f0a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/smc/smc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,8 @@ void smc_conn_free(struct smc_connection *conn)
11611161
cancel_work_sync(&conn->abort_work);
11621162
}
11631163
if (!list_empty(&lgr->list)) {
1164-
smc_lgr_unregister_conn(conn);
11651164
smc_buf_unuse(conn, lgr); /* allow buffer reuse */
1165+
smc_lgr_unregister_conn(conn);
11661166
}
11671167

11681168
if (!lgr->conns_num)

0 commit comments

Comments
 (0)