Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7484775ybp; Wed, 16 Oct 2019 09:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlkpupJgE8l0E5EuBfwS+mWiCgMD2c1fckCScP9QyqmuQYSXjmAu9snzCMmn+WY0oL7jWa X-Received: by 2002:a05:6402:1804:: with SMTP id g4mr40396683edy.266.1571242773512; 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=VRprD0gOQGTrNLCvxhLU4HxVHkfQ1TCeZkY0LEJA19a2J7PFewgwLrmDwDvz62HVsu VgKwPLKbLw1qTztDjG6e4zN52bG5zGVpwL6XNbsTTocJ4feI2Rxy5bz70+fGCcsve9uv vgf2ipuXYncM1Lecr6ivFPv3lEFkIuTzzHcSWFYZe8143Zliy371VPA3/fqEvVd4NrDl nBlGO2Q432f50ziCwq/NpAPI3mYIRa60DpP9zgqizt9CfxlpKdC9fvq13Y4d9L4g2uJF k9vyaokAaJ0Cq6xekGrmhiRJ+Wh1gqkTmK3v/b7mMSXv0KTG3ZmJMo1FKDuDsjmSxyXb 5tng== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HDETNY7WK9PJBRVGF2Wq3OyOQEyyC9mkVXUUeP9/L9o=; b=zCULPYFGQTlDqQHl4I2BQP437etyr8gVkMYotwj/TBK9Z1GIPwJUgQEq787+9wbcXb xKPbN9FUgyUO7gkDFfAMluWb3x5ZxpKTDQbtBnFLGklBY3pczE9ZwbaAqkQY8skVuUsk 9noRxUgH4bu8RAhEmisv6M621DWnvRCM10ATze61f5Dvuagct4ihYmL3FS8aS5xUPUan 1eZlYb3CWZLYcEI5GRDMOSktBMiJdsO3+N742degQTaFqmiwSYazOtVd+uAMLchzEkvA 8S4qHkEt1IeT21hHus2I6fuzy7zDbAuoOd+4a9L9eBNcCvzQr1MZSz387Oln8v0SlXi3 5GTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xtk6Olq4; 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 y12si15484393ejp.103.2019.10.16.09.18.57; 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=Xtk6Olq4; 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 S2392276AbfJPOR7 (ORCPT + 99 others); Wed, 16 Oct 2019 10:17:59 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:37105 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730937AbfJPOR7 (ORCPT ); Wed, 16 Oct 2019 10:17:59 -0400 Received: by mail-qk1-f195.google.com with SMTP id u184so22902633qkd.4 for ; Wed, 16 Oct 2019 07:17:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=HDETNY7WK9PJBRVGF2Wq3OyOQEyyC9mkVXUUeP9/L9o=; b=Xtk6Olq4TjBdfm8dEJi0Ty3kIAg1risZ49Iw/vG1qGLuHM8jWEA9Pc75UbUQoH3w1E pYaB0YOG4Sa7f22PzA3NPBryD/ZvEReJ2kz5F2LA5K2nu2dqhAPh5kChNyn6LC+/dRzJ yBTrDM+LBhjS8cma4d6A80qeL2BUMpFL1Rj9tPKBSZqFA9hCPGmvYa0D/OghQStz7yqc 4oNJWf+8iAamcx/zgthhB123FZrpFC/TK/zrx1GqqSKNsfqVkHZN9+N2kGEgbVKOsxfk RQeMxEXh46T5Mrym52ov8Q5kQ8LfyB/NHd8n93qUJDLfxExSUs268R+0g0V823RFICIU NXGQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HDETNY7WK9PJBRVGF2Wq3OyOQEyyC9mkVXUUeP9/L9o=; b=VM7xmBTNRkrrRCTPXmePyvjtpSf0UyHRZ+x/hFifREHR8OjdgZFVbtvItMXrCZloVq 7YlSZpwWvJd/ha6BVaOLAvXq1LsbJTm+l0zhOYNtE8UsO2RzdQEc6/ilCo70bZq65fzj s8ubCB5GOUuQWrGm8yx6tMNmBrM0guK2UAJEForAmPD2gevxnf22CydbyJjdkAlrD0wt unBwczgtk2Td9Vu6vrt1LidrcknwJSxFwfe8myosHoyJAszrGaJ8WbcObrllIS84gRsS otjTj2lINWMbypu9j0ashXay0+a7YD2ZNlxJOP6pU+w0FZQchXKDB7mneYTpoZ8JEx8U bWbA== X-Gm-Message-State: APjAAAUDzI333hYX8Blduv3BpvIBcANYy2X0s8TZjKBSccgC+OyOtBh1 J0AZdqa6lpRWFaW5YwOJFGL3aGg= X-Received: by 2002:a37:9904:: with SMTP id b4mr39869163qke.499.1571235477996; Wed, 16 Oct 2019 07:17:57 -0700 (PDT) Received: from localhost.localdomain ([66.187.232.65]) by smtp.gmail.com with ESMTPSA id g31sm14925361qte.78.2019.10.16.07.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 07:17:57 -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 2/3] SUNRPC: The RDMA back channel mustn't disappear while requests are outstanding Date: Wed, 16 Oct 2019 10:15:45 -0400 Message-Id: <20191016141546.32277-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191016141546.32277-1-trond.myklebust@hammerspace.com> References: <20191016141546.32277-1-trond.myklebust@hammerspace.com> 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 RDMA 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: 63cae47005af ("xprtrdma: Handle incoming backward direction RPC calls") Signed-off-by: Trond Myklebust --- net/sunrpc/xprtrdma/backchannel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c index 50e075fcdd8f..b458bf53ca69 100644 --- a/net/sunrpc/xprtrdma/backchannel.c +++ b/net/sunrpc/xprtrdma/backchannel.c @@ -163,6 +163,7 @@ void xprt_rdma_bc_free_rqst(struct rpc_rqst *rqst) spin_lock(&xprt->bc_pa_lock); list_add_tail(&rqst->rq_bc_pa_list, &xprt->bc_pa_list); spin_unlock(&xprt->bc_pa_lock); + xprt_put(xprt); } static struct rpc_rqst *rpcrdma_bc_rqst_get(struct rpcrdma_xprt *r_xprt) @@ -259,6 +260,7 @@ void rpcrdma_bc_receive_call(struct rpcrdma_xprt *r_xprt, /* Queue rqst for ULP's callback service */ bc_serv = xprt->bc_serv; + xprt_get(xprt); spin_lock(&bc_serv->sv_cb_lock); list_add(&rqst->rq_bc_list, &bc_serv->sv_cb_list); spin_unlock(&bc_serv->sv_cb_lock); -- 2.21.0