Merge branch 'two-fixes-for-smc'
Wen Gu says: ==================== two fixes for SMC This patch set contains two bugfixes, to fix SMC warning and panic issues in race conditions. ==================== Link: https://patch.msgid.link/20241127133014.100509-1-guwen@linux.alibaba.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
+3
-3
@@ -383,6 +383,7 @@ void smc_sk_init(struct net *net, struct sock *sk, int protocol)
|
||||
smc->limit_smc_hs = net->smc.limit_smc_hs;
|
||||
smc->use_fallback = false; /* assume rdma capability first */
|
||||
smc->fallback_rsn = 0;
|
||||
smc_close_init(smc);
|
||||
}
|
||||
|
||||
static struct sock *smc_sock_alloc(struct net *net, struct socket *sock,
|
||||
@@ -1299,7 +1300,6 @@ static int smc_connect_rdma(struct smc_sock *smc,
|
||||
goto connect_abort;
|
||||
}
|
||||
|
||||
smc_close_init(smc);
|
||||
smc_rx_init(smc);
|
||||
|
||||
if (ini->first_contact_local) {
|
||||
@@ -1435,7 +1435,6 @@ static int smc_connect_ism(struct smc_sock *smc,
|
||||
goto connect_abort;
|
||||
}
|
||||
}
|
||||
smc_close_init(smc);
|
||||
smc_rx_init(smc);
|
||||
smc_tx_init(smc);
|
||||
|
||||
@@ -1901,6 +1900,7 @@ static void smc_listen_out(struct smc_sock *new_smc)
|
||||
if (tcp_sk(new_smc->clcsock->sk)->syn_smc)
|
||||
atomic_dec(&lsmc->queued_smc_hs);
|
||||
|
||||
release_sock(newsmcsk); /* lock in smc_listen_work() */
|
||||
if (lsmc->sk.sk_state == SMC_LISTEN) {
|
||||
lock_sock_nested(&lsmc->sk, SINGLE_DEPTH_NESTING);
|
||||
smc_accept_enqueue(&lsmc->sk, newsmcsk);
|
||||
@@ -2422,6 +2422,7 @@ static void smc_listen_work(struct work_struct *work)
|
||||
u8 accept_version;
|
||||
int rc = 0;
|
||||
|
||||
lock_sock(&new_smc->sk); /* release in smc_listen_out() */
|
||||
if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN)
|
||||
return smc_listen_out_err(new_smc);
|
||||
|
||||
@@ -2479,7 +2480,6 @@ static void smc_listen_work(struct work_struct *work)
|
||||
goto out_decl;
|
||||
|
||||
mutex_lock(&smc_server_lgr_pending);
|
||||
smc_close_init(new_smc);
|
||||
smc_rx_init(new_smc);
|
||||
smc_tx_init(new_smc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user