From patchwork Thu Oct 16 19:40:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 5093981 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 6ABE59F30B for ; Thu, 16 Oct 2014 19:40:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74A14201F4 for ; Thu, 16 Oct 2014 19:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88AB5201EF for ; Thu, 16 Oct 2014 19:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbaJPTkL (ORCPT ); Thu, 16 Oct 2014 15:40:11 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:55774 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751887AbaJPTkK (ORCPT ); Thu, 16 Oct 2014 15:40:10 -0400 Received: by mail-ie0-f181.google.com with SMTP id at20so4129311iec.40 for ; Thu, 16 Oct 2014 12:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=6sIabMS1FjKZVHC4K4DOyn8735gm9TeBBQtp3p3ZSAo=; b=zMllTsLgoDj3wj94kmNLr+d4X7V5a1KfTIHz3ilxbsgWBdZdjfBbBdQb+IAGAWbShr wQUuabS9CNWRs4z6xlFkjzG5Zc0y5ZEuQ5ihoaSdE1MIyymJh7h5Apg5QcmoeW/6bzRn Nb9tq36wbrNh7j/m3xcmJHvGtJYdfTQuFxISMpmEXLas/qbzRBCcsd5pvXS/6LQ+Uvcm RgdK1qJiPS9h11QNaI1aAGVdEPipZXpLM2ozwCL2qkugZ08fxkvzYJf4l9+cefz6u4qx NZrCWItLPXFkbeGjQm7GPtDmlualCpE2wuodD1izkek+kGeE++MAr+g6nUh9BZRa+gaL lXjw== X-Received: by 10.107.160.208 with SMTP id j199mr4167061ioe.6.1413488409516; Thu, 16 Oct 2014 12:40:09 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id d5sm3482955ioj.30.2014.10.16.12.40.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Oct 2014 12:40:09 -0700 (PDT) Subject: [PATCH v1 14/16] NFS: Set BIND_CONN_TO_SESSION arguments in the proc layer From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 16 Oct 2014 15:40:08 -0400 Message-ID: <20141016194008.13414.6476.stgit@manet.1015granger.net> In-Reply-To: <20141016192919.13414.3151.stgit@manet.1015granger.net> References: <20141016192919.13414.3151.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-3-g7d0f 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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,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 When NFS_CS_SIDECAR_BACKCHANNEL is set, the client needs to bind both the forward and the back channel during recovery. Two separate BC2S operations are needed, with different arguments. Prepare nfs4_proc_bind_conn_to_session() by creating a complete arg struct for the BIND_CONN_TO_SESSION XDR encoder. Signed-off-by: Chuck Lever --- fs/nfs/nfs4proc.c | 6 +++++- fs/nfs/nfs4xdr.c | 16 +++++++++------- include/linux/nfs_xdr.h | 6 ++++++ 3 files changed, 20 insertions(+), 8 deletions(-) -- 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/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index a1243e7..9a8ffb7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6578,11 +6578,15 @@ nfs41_same_server_scope(struct nfs41_server_scope *a, int nfs4_proc_bind_conn_to_session(struct nfs_client *clp, struct rpc_cred *cred) { int status; + struct nfs41_bind_conn_to_session_args args = { + .client = clp, + .dir = NFS4_CDFC4_BACK_OR_BOTH, + }; struct nfs41_bind_conn_to_session_res res; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_BIND_CONN_TO_SESSION], - .rpc_argp = clp, + .rpc_argp = &args, .rpc_resp = &res, .rpc_cred = cred, }; diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e13b59d..6dfdd14 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -1733,17 +1733,19 @@ static void encode_secinfo(struct xdr_stream *xdr, const struct qstr *name, stru #if defined(CONFIG_NFS_V4_1) /* NFSv4.1 operations */ static void encode_bind_conn_to_session(struct xdr_stream *xdr, - struct nfs4_session *session, - struct compound_hdr *hdr) + struct nfs41_bind_conn_to_session_args *args, + struct compound_hdr *hdr) { + struct nfs4_session *session = args->client->cl_session; __be32 *p; encode_op_hdr(xdr, OP_BIND_CONN_TO_SESSION, decode_bind_conn_to_session_maxsz, hdr); encode_opaque_fixed(xdr, session->sess_id.data, NFS4_MAX_SESSIONID_LEN); + p = xdr_reserve_space(xdr, 8); - *p++ = cpu_to_be32(NFS4_CDFC4_BACK_OR_BOTH); - *p = 0; /* use_conn_in_rdma_mode = False */ + *p++ = cpu_to_be32(args->dir); + *p = args->use_conn_in_rdma_mode ? xdr_one : xdr_zero; } static void encode_op_map(struct xdr_stream *xdr, struct nfs4_op_map *op_map) @@ -2766,14 +2768,14 @@ static void nfs4_xdr_enc_fsid_present(struct rpc_rqst *req, */ static void nfs4_xdr_enc_bind_conn_to_session(struct rpc_rqst *req, struct xdr_stream *xdr, - struct nfs_client *clp) + struct nfs41_bind_conn_to_session_args *args) { struct compound_hdr hdr = { - .minorversion = clp->cl_mvops->minor_version, + .minorversion = args->client->cl_mvops->minor_version, }; encode_compound_hdr(xdr, req, &hdr); - encode_bind_conn_to_session(xdr, clp->cl_session, &hdr); + encode_bind_conn_to_session(xdr, args, &hdr); encode_nops(&hdr); } diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 0040629..af17763 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1140,6 +1140,12 @@ struct nfs41_state_protection { struct nfs4_op_map allow; }; +struct nfs41_bind_conn_to_session_args { + struct nfs_client *client; + u32 dir; + bool use_conn_in_rdma_mode; +}; + #define NFS4_EXCHANGE_ID_LEN (48) struct nfs41_exchange_id_args { struct nfs_client *client;