From patchwork Wed Dec 24 07:12:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5536851 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8BC4B9F301 for ; Wed, 24 Dec 2014 07:13:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DFFA200F2 for ; Wed, 24 Dec 2014 07:13:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93A67200F0 for ; Wed, 24 Dec 2014 07:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbaLXHNo (ORCPT ); Wed, 24 Dec 2014 02:13:44 -0500 Received: from mail-ig0-f177.google.com ([209.85.213.177]:44910 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbaLXHNo (ORCPT ); Wed, 24 Dec 2014 02:13:44 -0500 Received: by mail-ig0-f177.google.com with SMTP id z20so6617441igj.4 for ; Tue, 23 Dec 2014 23:13:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=epoCuBb5C8jrtR6WiBJtYRHtjDSSF+Pr4Zo1JdsZJ38=; b=ZcBz3l0hCahG3e8DJJdVUZp84Wxm85baDHrPELkzF/1u2baAYqfy6t8Ma/GCS3WDlI a6s4ufehLFZ/HSEh0oQ748KB0vN11FCkS0AeFNYxFrXjo6F5+zlx14Udp6DwNL/lP++8 bmHPkzItmS3L2I3hxCsPvtqscWS0xhxP1DY8t6b9JVncxnOU+WWEcELafWBSpp0PwZx7 RNd7QSd21NkIsuHzC/PydrbgBJzqnfVzSYgJk35Of7D8BTWJ/WSzhmDfN0bJKW5MSpnM S17Cidvv8QZDYBsFSRM34LuT2ITUhaQ02Pkt6cSIarcjmsk7S7lEKKHshtS+0GDaS9Es 5DOw== X-Gm-Message-State: ALoCoQmB256tjVuIzdfSvrYEbBg28wUXg5Rd/XUQyRVvMR0GUiJ76hgAPndEi6oLnUQ0qBnwjIjc X-Received: by 10.107.131.102 with SMTP id f99mr29306779iod.31.1419405223529; Tue, 23 Dec 2014 23:13:43 -0800 (PST) Received: from localhost.localdomain (c-68-40-185-14.hsd1.mi.comcast.net. [68.40.185.14]) by mx.google.com with ESMTPSA id 37sm8821410iog.39.2014.12.23.23.13.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Dec 2014 23:13:43 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH v2 06/49] nfs41: allow LD to choose DS connection auth flavor Date: Tue, 23 Dec 2014 23:12:45 -0800 Message-Id: <1419405208-25975-7-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1419405208-25975-1-git-send-email-loghyr@primarydata.com> References: <1419405208-25975-1-git-send-email-loghyr@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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: Peng Tao flexfile layout may use different auth flavor as specified by MDS. Reviewed-by: Jeff Layton Signed-off-by: Peng Tao Signed-off-by: Tom Haynes --- fs/nfs/filelayout/filelayoutdev.c | 3 ++- fs/nfs/internal.h | 3 ++- fs/nfs/nfs4client.c | 5 +++-- fs/nfs/pnfs.h | 2 +- fs/nfs/pnfs_dev.c | 10 ++++++---- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fs/nfs/filelayout/filelayoutdev.c b/fs/nfs/filelayout/filelayoutdev.c index 27bdd8c..5e4b0ce 100644 --- a/fs/nfs/filelayout/filelayoutdev.c +++ b/fs/nfs/filelayout/filelayoutdev.c @@ -278,7 +278,8 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx) goto out_test_devid; nfs4_pnfs_ds_connect(s, ds, devid, dataserver_timeo, - dataserver_retrans); + dataserver_retrans, + s->nfs_client->cl_rpcclient->cl_auth->au_flavor); out_test_devid: if (filelayout_test_devid_unavailable(devid)) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index efaa31c..7d7c36f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -189,7 +189,8 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, const struct sockaddr *ds_addr, int ds_addrlen, int ds_proto, unsigned int ds_timeo, - unsigned int ds_retrans); + unsigned int ds_retrans, + rpc_authflavor_t au_flavor); extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, struct inode *); #ifdef CONFIG_PROC_FS diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 0331125..61d552d 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -837,7 +837,8 @@ error: */ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, const struct sockaddr *ds_addr, int ds_addrlen, - int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans) + int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans, + rpc_authflavor_t au_flavor) { struct nfs_client_initdata cl_init = { .addr = ds_addr, @@ -862,7 +863,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, */ nfs_init_timeout_values(&ds_timeout, ds_proto, ds_timeo, ds_retrans); clp = nfs_get_client(&cl_init, &ds_timeout, mds_clp->cl_ipaddr, - mds_clp->cl_rpcclient->cl_auth->au_flavor); + au_flavor); dprintk("<-- %s %p\n", __func__, clp); return clp; diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 4c53f16..cb666e8 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -297,7 +297,7 @@ struct nfs4_pnfs_ds *nfs4_pnfs_ds_add(struct list_head *dsaddrs, gfp_t gfp_flags); void nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds, struct nfs4_deviceid_node *devid, unsigned int timeo, - unsigned int retrans); + unsigned int retrans, rpc_authflavor_t au_flavor); struct nfs4_pnfs_ds_addr *nfs4_decode_mp_ds_addr(struct net *net, struct xdr_stream *xdr, gfp_t gfp_flags); diff --git a/fs/nfs/pnfs_dev.c b/fs/nfs/pnfs_dev.c index a4e33aa..f819aa3 100644 --- a/fs/nfs/pnfs_dev.c +++ b/fs/nfs/pnfs_dev.c @@ -618,7 +618,8 @@ static void nfs4_clear_ds_conn_bit(struct nfs4_pnfs_ds *ds) static int _nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds, unsigned int timeo, - unsigned int retrans) + unsigned int retrans, + rpc_authflavor_t au_flavor) { struct nfs_client *clp = ERR_PTR(-EIO); struct nfs4_pnfs_ds_addr *da; @@ -634,7 +635,7 @@ static int _nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, clp = nfs4_set_ds_client(mds_srv->nfs_client, (struct sockaddr *)&da->da_addr, da->da_addrlen, IPPROTO_TCP, - timeo, retrans); + timeo, retrans, au_flavor); if (!IS_ERR(clp)) break; } @@ -665,12 +666,13 @@ out_put: */ void nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds, struct nfs4_deviceid_node *devid, unsigned int timeo, - unsigned int retrans) + unsigned int retrans, rpc_authflavor_t au_flavor) { if (test_and_set_bit(NFS4DS_CONNECTING, &ds->ds_state) == 0) { int err = 0; - err = _nfs4_pnfs_ds_connect(mds_srv, ds, timeo, retrans); + err = _nfs4_pnfs_ds_connect(mds_srv, ds, timeo, + retrans, au_flavor); if (err) nfs4_mark_deviceid_unavailable(devid); nfs4_clear_ds_conn_bit(ds);