From patchwork Fri Nov 15 09:38:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "liujian (CE)" X-Patchwork-Id: 13876007 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0990E18785D; Fri, 15 Nov 2024 09:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731662504; cv=none; b=fQBVw6toINyE0fq3kL1JQ+Ks2CZpyOdMfsGH0uM7inSSkjQiohxIBg1W/rON2IADR6CKgiE8IwYowSgyS16TN17tkJkgPwodumOXsJnLvI9jxgManwCaiyhz+HazBQxHUOR7iPpDXCm2ZPD6oX7Gu9BTXupS4yvtWHQMV3oGnLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731662504; c=relaxed/simple; bh=4mL2KcxRoDYVRV/FTNeMeIO34Rqn6F5VHmFisLPKuY4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=r4edjcHRBon5dEtQfEwPR7GVRWCeHHZhCmpN/l4NImKiuFtaDNw2//MN96aow+ils7R+Wzyv6DlbRfhh5puYUpWn0VI4ZaJVe0G9aXs1v9ZPgP4cH0Bs2GUfep4+LSfpZThfPJLFESV217al3mk+6uj/Oz7xVU0t+QqiES/Fl/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XqWfg3LJYz926T; Fri, 15 Nov 2024 17:18:51 +0800 (CST) Received: from kwepemg200003.china.huawei.com (unknown [7.202.181.30]) by mail.maildlp.com (Postfix) with ESMTPS id 79087180102; Fri, 15 Nov 2024 17:21:32 +0800 (CST) Received: from huawei.com (10.175.101.6) by kwepemg200003.china.huawei.com (7.202.181.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 15 Nov 2024 17:21:31 +0800 From: Liu Jian To: , , , , , , , , , , , , CC: , , Subject: [PATCH] sunrpc: clear XPRT_SOCK_UPD_TIMEOUT when reset transport Date: Fri, 15 Nov 2024 17:38:04 +0800 Message-ID: <20241115093804.1634328-1-liujian56@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemg200003.china.huawei.com (7.202.181.30) 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: 7196dbb02ea0 ("SUNRPC: Allow changing of the TCP timeout parameters on the fly") Signed-off-by: Li Lingfeng Signed-off-by: Liu Jian --- net/sunrpc/xprtsock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 906a1b563aee..2a7e33abe151 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1198,6 +1198,7 @@ static void xs_sock_reset_state_flags(struct rpc_xprt *xprt) clear_bit(XPRT_SOCK_WAKE_WRITE, &transport->sock_state); clear_bit(XPRT_SOCK_WAKE_DISCONNECT, &transport->sock_state); clear_bit(XPRT_SOCK_NOSPACE, &transport->sock_state); + clear_bit(XPRT_SOCK_UPD_TIMEOUT, &transport->sock_state); } static void xs_run_error_worker(struct sock_xprt *transport, unsigned int nr)