Commit ca2619d2 authored by Liu Jian's avatar Liu Jian
Browse files

sunrpc: clear XPRT_SOCK_UPD_TIMEOUT when reset transport

mainline inclusion
from mainline-v6.13-rc1
commit 4db9ad82a6c823094da27de4825af693a3475d51
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB4JBR
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4db9ad82a6c823094da27de4825af693a3475d51



-------------------------------------------------

Since transport->sock has been set to NULL during reset transport,
XPRT_SOCK_UPD_TIMEOUT also needs to be cleared. Otherwise, the
xs_tcp_set_socket_timeouts() may be triggered in xs_tcp_send_request()
to dereference the transport->sock that has been set to NULL.

Fixes: 7196dbb0 ("SUNRPC: Allow changing of the TCP timeout parameters on the fly")
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>

Conflicts:
	net/sunrpc/xprtsock.c
[Did not backport 4f8943f8.]
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
parent 5189a49e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -799,6 +799,7 @@ static void xs_sock_reset_state_flags(struct rpc_xprt *xprt)
	struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);

	clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state);
	clear_bit(XPRT_SOCK_UPD_TIMEOUT, &transport->sock_state);
}

static void xs_sock_reset_connection_flags(struct rpc_xprt *xprt)