Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7484774ybp; Wed, 16 Oct 2019 09:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5ifs3dnmdA+4eWO2GNumCH7u04P+yBSzt8X4iykJiuUs9G+cq2ZjKFta6A+orIPz7f8+j X-Received: by 2002:aa7:d8ca:: with SMTP id k10mr40776952eds.54.1571242773500; Wed, 16 Oct 2019 09:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571242773; cv=none; d=google.com; s=arc-20160816; b=SF8aasyUttyEdSmw6tuNNEw9WWuTd+TVoop1db5BRT4g3AQGeAQPtFjRnny2XsBrtF svbTIJYkAC84+3t+ZqnncOiIKdFk3xpyrUbG+nkVyexQiLl9gpUxV7005cluJkT937jb kgBsjZbQh02oMI/FDsvc7KpUdvIBDKQyrU3TB+dRduFdXgx/apHWrFXQj2rU5iBMmyTO jFP2Z5l4D2sfdLfCSj3HguTBn5t5r6KSbpXrFcw1HHmRPRwDf/3HtnngVOJIiANBMQox AOFTsB36UDyXh//P53S6//gF+h5mQ7cylDmh58wUqUihF4xN027B4xdN9e3X6T5KHQ4s IEKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=muyrwKCkKeapXczyZQbXCsQey1nBdQol/tef0UdG3SI=; b=Da4W/vAMPahNdlYMVzsqrHg8IaiolkTEVT7K8aiJMpenQjAvAmaUnQqJHhddcwjJq5 yYfi9pNMxc398k3qcS29ZeXiInOt8PUT8Xn6FFTZfFwIWo9Qu5BPN8+GC+eKc8Lhk1b1 xdkCmIqRP9wy6P//vrc93agwydSVpJCLCWKvswf5IQx2VK/NfN1a2xjoy9Xkxx5SMEfQ 0whNARiU9uU3FvMRg7RkOV7QSJagPbiQklAl+t5MTzK+577Qs3LhxjoxPa8mbLn85jCr qBdf9JS++OF+bM/CZXv3N1GG1t6RrgxSaYKM1V9jzG4rpGJfNfPtpnFhzwQwFq68xGyi F9Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GM5TrleV; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si16817109eda.445.2019.10.16.09.18.58; Wed, 16 Oct 2019 09:19:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GM5TrleV; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392279AbfJPOR6 (ORCPT + 99 others); Wed, 16 Oct 2019 10:17:58 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:45306 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730937AbfJPOR6 (ORCPT ); Wed, 16 Oct 2019 10:17:58 -0400 Received: by mail-qt1-f193.google.com with SMTP id c21so36264992qtj.12 for ; Wed, 16 Oct 2019 07:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=muyrwKCkKeapXczyZQbXCsQey1nBdQol/tef0UdG3SI=; b=GM5TrleVwG9yaVD6iv+CS/z0xrNsp6+EmNZUcfcs7pyIzYnoe5MCyLcFIB7EPdyl89 vVo2lZ4siRmS2ALccwmEZWtZ30iIJi9HgTRGMBgOj8caUgSBiMVAxgbHvHAxaTA+qgWn IdV9ev5VFjPGaiGcUU3E3CQ9YRNTamU7hkokIdUo7N06XJzoBQxWZjz2v6UtoTIpEVOV +v+BOgK9IJ/8OSWb4uOhyNzBsTRbpKDRzUShJ4bXGzTEUnhaCrInpGQ/3szoIWB+q2s1 Rgbpfd/02/w9ArhEFRojrLxSBdvEp+t2/WqCNRqLeUc2/9HT6GOZEkYPGc9rY19OWo1L QS6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=muyrwKCkKeapXczyZQbXCsQey1nBdQol/tef0UdG3SI=; b=kzEHad8JFsttrcszvx+lV3JrbR9FNUKf52TnYQsslI0c4jvCOcAKWcz9A4g5SWiOXe NwEsxH8q/H+kl9npW26ZC6LqZ/chQz/vgHz4g+X/AwkqbEOt3Vebl07S7CSBth1g3XjG J9ZtT7C1ja+uel6MhHvXFhGtAlXSCuc1Pmi6IhdvNkTVYDJU0vK8B58X/nN0LLRTrJuV OJ9pT1///nbX5C9OVy/th+k1LStf/JqBaRuNwEHa81H/Wb7c+Q5HLNFumHmSRcrOpQdl 3RrF9LOlndpthbq1pM8tfOYibFn8T6ufAJGAH8xjYbJ5ZNNf7k9fQzdSZZngN5n7L4ZI pRWg== X-Gm-Message-State: APjAAAUjvnF6VNWWTdrYXM9PuyQGiJAvFFHFtmGar9qsLsoy7rGzyfzY m3HtihvFtny+3b8W4tUfCi0qPhY= X-Received: by 2002:a05:6214:841:: with SMTP id dg1mr41838943qvb.55.1571235476441; Wed, 16 Oct 2019 07:17:56 -0700 (PDT) Received: from localhost.localdomain ([66.187.232.65]) by smtp.gmail.com with ESMTPSA id g31sm14925361qte.78.2019.10.16.07.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 07:17:55 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Cc: Neil Brown , Chuck Lever , Anna Schumaker , "J. Bruce Fields" Subject: [PATCH 1/3] SUNRPC: The TCP back channel mustn't disappear while requests are outstanding Date: Wed, 16 Oct 2019 10:15:44 -0400 Message-Id: <20191016141546.32277-1-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If there are TCP back channel requests either being processed by the server threads, then we should hold a reference to the transport to ensure it doesn't get freed from underneath us. Reported-by: Neil Brown Fixes: 2ea24497a1b3 ("SUNRPC: RPC callbacks may be split across several..") Signed-off-by: Trond Myklebust --- net/sunrpc/backchannel_rqst.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c index 339e8c077c2d..7eb251372f94 100644 --- a/net/sunrpc/backchannel_rqst.c +++ b/net/sunrpc/backchannel_rqst.c @@ -307,8 +307,8 @@ void xprt_free_bc_rqst(struct rpc_rqst *req) */ dprintk("RPC: Last session removed req=%p\n", req); xprt_free_allocation(req); - return; } + xprt_put(xprt); } /* @@ -339,7 +339,7 @@ struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid) spin_unlock(&xprt->bc_pa_lock); if (new) { if (req != new) - xprt_free_bc_rqst(new); + xprt_free_allocation(new); break; } else if (req) break; @@ -368,6 +368,7 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied) set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); dprintk("RPC: add callback request to list\n"); + xprt_get(xprt); spin_lock(&bc_serv->sv_cb_lock); list_add(&req->rq_bc_list, &bc_serv->sv_cb_list); wake_up(&bc_serv->sv_cb_waitq); -- 2.21.0