From patchwork Wed Aug 3 19:40:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 9262157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E6DC6048B for ; Wed, 3 Aug 2016 20:02:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 782CD27DE0 for ; Wed, 3 Aug 2016 20:02:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CE03281DB; Wed, 3 Aug 2016 20:02:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B9D127DE0 for ; Wed, 3 Aug 2016 20:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757685AbcHCUCb (ORCPT ); Wed, 3 Aug 2016 16:02:31 -0400 Received: from aserp1050.oracle.com ([141.146.126.70]:23099 "EHLO aserp1050.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755611AbcHCUCa convert rfc822-to-8bit (ORCPT ); Wed, 3 Aug 2016 16:02:30 -0400 Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by aserp1050.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u73JfHda015873 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 3 Aug 2016 19:41:17 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u73JeERM025252 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Aug 2016 19:40:14 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u73JeDwS020012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Aug 2016 19:40:13 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u73JeCBF008214; Wed, 3 Aug 2016 19:40:13 GMT Received: from anon-dhcp-171.1015granger.net (/68.46.169.226) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Aug 2016 12:40:12 -0700 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: WARN_ON added to rpc_create() From: Chuck Lever In-Reply-To: <20160803174724.GA5993@fieldses.org> Date: Wed, 3 Aug 2016 15:40:11 -0400 Cc: "J. Bruce Fields" , Linux NFS Mailing List Message-Id: <5E7D6A55-B7F3-411D-A74B-E8BCE04BCF02@oracle.com> References: <42D0C152-58F9-4467-B86D-2A7A25544CE4@oracle.com> <20160803174724.GA5993@fieldses.org> To: "J. Bruce Fields" X-Mailer: Apple Mail (2.3124) X-Source-IP: aserp1040.oracle.com [141.146.126.69] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > On Aug 3, 2016, at 1:47 PM, bfields@fieldses.org wrote: > > On Wed, Aug 03, 2016 at 11:27:47AM -0400, Chuck Lever wrote: >> Hi Bruce- >> >> I see that commit 39a9beab5acb83176e8b9a4f0778749a09341f1f >> Author: J. Bruce Fields >> AuthorDate: Tue May 17 12:38:21 2016 -0400 >> >> rpc: share one xps between all backchannels >> >> has added this piece of code: >> >> @@ -452,10 +452,20 @@ static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args, >> struct rpc_clnt *clnt = NULL; >> struct rpc_xprt_switch *xps; >> >> - xps = xprt_switch_alloc(xprt, GFP_KERNEL); >> - if (xps == NULL) { >> - xprt_put(xprt); >> - return ERR_PTR(-ENOMEM); >> + if (args->bc_xprt && args->bc_xprt->xpt_bc_xps) { >> + WARN_ON(args->protocol != XPRT_TRANSPORT_BC_TCP); >> + xps = args->bc_xprt->xpt_bc_xps; >> + xprt_switch_get(xps); >> + } else { >> >> >> the WARN_ON here fires on the server whenever I use NFSv4.1 on RDMA. >> >> Can you say why it was added? Is there something RPC/RDMA needs to >> do to make the code safe? > > What is args->protocol in this case? > > Digging around... OK, I missed that BC_TCP and BC_RDMA were defined as > OR's of an XPRT_TRANSPORT_BC bit with the identifier of the underlying > transport. That makes sense. > > So, I should have just used XPRT_TRANSPORT_BC there--I think all I meant > was "is this a backchannel". > > Does that fix the problem? This simple fix eliminates the log noise: This code seems to come from: commit d50039ea5ee63c589b0434baa5ecf6e5075bb6f9 Author: J. Bruce Fields AuthorDate: Mon May 16 17:03:42 2016 -0400 nfsd4/rpc: move backchannel create logic into rpc code Where it may have been copied from: -static struct rpc_clnt *create_backchannel_client(struct rpc_create_args *args) -{ - struct rpc_xprt *xprt; - - if (args->protocol != XPRT_TRANSPORT_BC_TCP) - return rpc_create(args); - - xprt = args->bc_xprt->xpt_bc_xprt; - if (xprt) { - xprt_get(xprt); - return rpc_create_xprt(args, xprt); - } - - return rpc_create(args); -} There's no warning here. In fact, protocol != BC_TCP seems to be expected. I'm wondering if the warning is needed at all? --- Chuck Lever -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 2808d55..f94caf7 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -520,7 +520,7 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) char servername[48]; if (args->bc_xprt) { - WARN_ON(args->protocol != XPRT_TRANSPORT_BC_TCP); + WARN_ON(!(args->protocol & XPRT_TRANSPORT_BC)); xprt = args->bc_xprt->xpt_bc_xprt; if (xprt) { xprt_get(xprt);