From patchwork Fri Feb 5 21:08:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 8239331 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EEAA4BEEE5 for ; Fri, 5 Feb 2016 21:08:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37139203AB for ; Fri, 5 Feb 2016 21:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52ABC203A9 for ; Fri, 5 Feb 2016 21:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751364AbcBEVIu (ORCPT ); Fri, 5 Feb 2016 16:08:50 -0500 Received: from mx143.netapp.com ([216.240.21.24]:25302 "EHLO mx143.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbcBEVIs (ORCPT ); Fri, 5 Feb 2016 16:08:48 -0500 X-IronPort-AV: E=Sophos;i="5.22,402,1449561600"; d="scan'208";a="95235529" Received: from vmwexchts02-prd.hq.netapp.com ([10.122.105.23]) by mx143-out.netapp.com with ESMTP; 05 Feb 2016 13:08:48 -0800 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCHTS02-PRD.hq.netapp.com (10.122.105.23) with Microsoft SMTP Server id 15.0.1156.6; Fri, 5 Feb 2016 13:08:48 -0800 Received: from localhost.localdomain (andros-new.vpn.netapp.com [10.55.67.64]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id u15L8ivb027795; Fri, 5 Feb 2016 13:08:47 -0800 (PST) From: To: CC: , Andy Adamson Subject: [PATCH RFC Version 1 4/6] NFS session trunking support: add trunk xprt to nfs4.1 mount Date: Fri, 5 Feb 2016 16:08:36 -0500 Message-ID: <1454706518-4641-5-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1454706518-4641-1-git-send-email-andros@netapp.com> References: <1454706518-4641-1-git-send-email-andros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Adamson Signed-off-by: Andy Adamson --- fs/nfs/nfs4client.c | 16 +++++++++++++++- net/sunrpc/xprtmultipath.c | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 5f20acf..6736805 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -412,8 +412,22 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp, if (error < 0) goto error; - if (clp != old) + if (clp != old) { + if (clp->cl_minorversion != 0) { + struct rpc_xprt *add = clp->cl_rpcclient->cl_xprt; + struct xprt_create xprt_args = { + .ident = XPRT_TRANSPORT_TCP, + .net = old->cl_net, /* clp->cl_net ??*/ + .dstaddr = (struct sockaddr *)&add->addr, + .addrlen = add->addrlen, + .servername = clp->cl_hostname, + }; + /* Add this address as an alias */ + rpc_clnt_add_xprt(old->cl_rpcclient, &xprt_args, + rpc_clnt_test_and_add_xprt, NULL); + } clp->cl_preserve_clid = true; + } nfs_put_client(clp); return old; diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c index 7be5bd2..f13419e 100644 --- a/net/sunrpc/xprtmultipath.c +++ b/net/sunrpc/xprtmultipath.c @@ -35,6 +35,8 @@ static void xprt_switch_add_xprt_locked(struct rpc_xprt_switch *xps, if (xps->xps_nxprts == 0) xps->xps_net = xprt->xprt_net; xps->xps_nxprts++; + pr_info("RPC: ADDED %s to xps %p xps_nxprts %d\n", + xprt->servername, xps, xps->xps_nxprts); } /**