Commit 8c96feee authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

net/smc: no close wait in case of process shut down

Usually socket closing is delayed if there is still data available in
the send buffer to be transmitted. If a process is killed, the delay
should be avoided.
Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18e537cd
...@@ -174,15 +174,15 @@ int smc_close_active(struct smc_sock *smc) ...@@ -174,15 +174,15 @@ int smc_close_active(struct smc_sock *smc)
{ {
struct smc_cdc_conn_state_flags *txflags = struct smc_cdc_conn_state_flags *txflags =
&smc->conn.local_tx_ctrl.conn_state_flags; &smc->conn.local_tx_ctrl.conn_state_flags;
long timeout = SMC_MAX_STREAM_WAIT_TIMEOUT;
struct smc_connection *conn = &smc->conn; struct smc_connection *conn = &smc->conn;
struct sock *sk = &smc->sk; struct sock *sk = &smc->sk;
int old_state; int old_state;
long timeout;
int rc = 0; int rc = 0;
if (sock_flag(sk, SOCK_LINGER) && timeout = current->flags & PF_EXITING ?
!(current->flags & PF_EXITING)) 0 : sock_flag(sk, SOCK_LINGER) ?
timeout = sk->sk_lingertime; sk->sk_lingertime : SMC_MAX_STREAM_WAIT_TIMEOUT;
again: again:
old_state = sk->sk_state; old_state = sk->sk_state;
...@@ -413,13 +413,14 @@ void smc_close_sock_put_work(struct work_struct *work) ...@@ -413,13 +413,14 @@ void smc_close_sock_put_work(struct work_struct *work)
int smc_close_shutdown_write(struct smc_sock *smc) int smc_close_shutdown_write(struct smc_sock *smc)
{ {
struct smc_connection *conn = &smc->conn; struct smc_connection *conn = &smc->conn;
long timeout = SMC_MAX_STREAM_WAIT_TIMEOUT;
struct sock *sk = &smc->sk; struct sock *sk = &smc->sk;
int old_state; int old_state;
long timeout;
int rc = 0; int rc = 0;
if (sock_flag(sk, SOCK_LINGER)) timeout = current->flags & PF_EXITING ?
timeout = sk->sk_lingertime; 0 : sock_flag(sk, SOCK_LINGER) ?
sk->sk_lingertime : SMC_MAX_STREAM_WAIT_TIMEOUT;
again: again:
old_state = sk->sk_state; old_state = sk->sk_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment