From patchwork Tue May 22 19:28:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10419437 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 183266032A for ; Tue, 22 May 2018 19:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071CC28E90 for ; Tue, 22 May 2018 19:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDA4C28E94; Tue, 22 May 2018 19:28:58 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 1501428E90 for ; Tue, 22 May 2018 19:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946AbeEVT2z (ORCPT ); Tue, 22 May 2018 15:28:55 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:46694 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751858AbeEVT2y (ORCPT ); Tue, 22 May 2018 15:28:54 -0400 Received: by mail-ua0-f195.google.com with SMTP id e8-v6so13090152uam.13 for ; Tue, 22 May 2018 12:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XKZUpy7haA7bhXdZqNVvkLBujpBmhDvIe+jpEoA4o/I=; b=Z2JNNQ5GJp9Uq+Go+/xm7o3XtIK8arPKaxBXzjDqlitxaZ/D4gWnrCyoxwq7Cee68C TxGvSBqp/FQkaFt7P7oYP/aps3G1GVYwk52JT3rPNVpbREDCqNrO2AMsbBXP6AmyX9fv mulPuiUdM330KuGkn54B8NSF7Hu5joh4D2iAUY54woG7EyaLNbFLZslIk0Z+ESX2m3IJ 3wucXeNncDGR7y/XR0bleZpJH+U3yCQjz0JvQVzh+OwNoJPaGDzj6Y3vM7HdNcW4UB5Q 8S3JtZPAJS/O0wOLxBG6I2XGZYnfbO5d1hL+BmItN9NZovDpQuS/eKhCcC+WSCGngI1r hUcA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XKZUpy7haA7bhXdZqNVvkLBujpBmhDvIe+jpEoA4o/I=; b=EOrcZdCYBidjzum4qnB8MAu2hEP8rZxK+xdQTL82pt+FeHv3Ta0BuO0OPdJ26TcS47 ZxSSWNXbBomIcfhHswfysIfnn67++axh1+g+9eCobTHZSNpO1Pt9xCVvwFZLRT6fj0TR WtHy6JceEG4sCDbINHDSv59zeTbhJLzQXfM3IyuMg9IIvgcg3kwfH7a5tRkfEBxQqVwN v7XvXX1KSb9AdEECQJX/MkIGZ4vNrH2rGlocB8r4bUAslXvVHl9g5nx5XIsq6qyT3gGJ TzJLltjQILF6iGMXiBajTJjzT98kingFIVrFMNAH7I25iNEluhzzwVNVy5ssschc3ybj wSvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XKZUpy7haA7bhXdZqNVvkLBujpBmhDvIe+jpEoA4o/I=; b=Q3jJms6K2Fp1Qr9KiQDulNP0DJmITZwoDgRZbIF6joww6TjtzVDd0Iyq7Dh40VNfqk Qpk33XjRNuPyGgQsU5gB3Vrw43BytXqp+5W1rpL8Z+GcRzeweNUl9NReeNEAEogOAfcK dm7obqps6j+8JFWk+Yi58noz754mAIDfJ4EZB3M2xZUn3FvSncWyOpnRhwpabNZlgtCs fcboqbYC6Ef0LPGUSAYfchBa6hOv29khFY+lbIgdB6y2eDTPbADFi6YDpHkZ5C2Sg1vO si2XQzVU+ufWvgNJ4277zLPA87umIFgKiD5hjYt9C2aiBxN1CPQuYIqi8tAyb74zDz4n h40A== X-Gm-Message-State: ALKqPwfy8v54RMsFyR1JByUR828dC1lroGuRbJTvl5YjqokMnE4VHAf8 VYCpSpA85PLbXrVCp1J6xD3/wUB6qlxaTm1Z1S0= X-Google-Smtp-Source: AB8JxZq0Y8ReX2FHyTQ2LsN7xPg2LVLNSrt4X/SL9KVd7n1So2G2C/PlaVxNjyQK99Qe4YR7HavHLstx4NYmQuhMDA8= X-Received: by 2002:ab0:486a:: with SMTP id c39-v6mr18487404uad.36.1527017333385; Tue, 22 May 2018 12:28:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:cf49:0:0:0:0:0 with HTTP; Tue, 22 May 2018 12:28:52 -0700 (PDT) In-Reply-To: References: <20180522184048.21586-1-kolga@netapp.com> From: Olga Kornievskaia Date: Tue, 22 May 2018 15:28:52 -0400 X-Google-Sender-Auth: -nrW7K2L8lCIleNEvqn_BhbMrE0 Message-ID: Subject: Re: [PATCH 1/1] [SUNRPC] make sure to clone timeout values To: Trond Myklebust Cc: "anna.schumaker@netapp.com" , "kolga@netapp.com" , "linux-nfs@vger.kernel.org" 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 Tue, May 22, 2018 at 3:03 PM, Trond Myklebust wrote: > On Tue, 2018-05-22 at 14:40 -0400, Olga Kornievskaia wrote: >> From: Olga Kornievskaia >> >> For pNFS, the operations to DS currently timeout in 10s. According >> to the spec, the client must not be re-trying an NFSv4.1 operation >> unless the connection was broken. >> >> Signed-off-by: Olga Kornievskaia >> --- >> net/sunrpc/clnt.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c >> index 6e432ec..97517eb 100644 >> --- a/net/sunrpc/clnt.c >> +++ b/net/sunrpc/clnt.c >> @@ -668,6 +668,7 @@ struct rpc_clnt * >> .prognumber = clnt->cl_prog, >> .version = clnt->cl_vers, >> .authflavor = flavor, >> + .timeout = clnt->cl_timeout, >> }; >> return __rpc_clone_client(&args, clnt); >> } > > What does this patch have to do with pNFS? That's the generic RPC > client cloning API you are changing. > > The pNFS/files timeouts are intended to be set using the > dataserver_retrans and dataserver_timeo module parameters described at > the bottom of fs/nfs/filelayout/filelayoutdev.c Ok so perhaps the code needs to re-written so that it allows for the DS to get an rpc client with its timeouts set. Which currently doesn't happen. From what I could tell the DS code tries to set the timeout values in nfs4_set_ds_client() but that has no effect. nfs4_find_or_create_ds_client() calls rpc_clone_client_set_auth() which creates an rpc client but the timeout that were set are ignored and instead the rpc client is getting created with this 10s timeout. (but I thought that in general it made sense that a clone also copies the timeout values) Is that more acceptable? * @args: pointer to the new transport arguments > > -- > Trond Myklebust > Linux NFS client maintainer, Hammerspace > trond.myklebust@hammerspace.com > --- 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/nfs4client.c b/fs/nfs/nfs4client.c index 04612c2..2c81eef8 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -99,7 +99,7 @@ struct nfs4_ds_server { if (dss == NULL) return ERR_PTR(-ENOMEM); - dss->rpc_clnt = rpc_clone_client_set_auth(ds_clp->cl_rpcclient, flavor); + dss->rpc_clnt = rpc_clone_client_set_auth_and_timeout(ds_clp->cl_rpcclient, flavor); if (IS_ERR(dss->rpc_clnt)) { int err = PTR_ERR(dss->rpc_clnt); kfree (dss); diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index ed761f7..1c2b317 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -150,6 +150,8 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); struct rpc_clnt *rpc_clone_client_set_auth(struct rpc_clnt *, rpc_authflavor_t); +struct rpc_clnt *rpc_clone_client_set_auth_and_timeout(struct rpc_clnt *, + rpc_authflavor_t); int rpc_switch_client_transport(struct rpc_clnt *, struct xprt_create *, const struct rpc_timeout *); diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 6e432ec..50a4a44 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -674,6 +674,29 @@ struct rpc_clnt * EXPORT_SYMBOL_GPL(rpc_clone_client_set_auth); /** + * rpc_clone_client_set_auth_and_timeout - Clone an RPC client structure + * and set its auth and timeouts + * + * @clnt: RPC client whose parameters are copied + * @flavor: security flavor for new client + * + * Returns a fresh RPC client or an ERR_PTR. + */ +struct rpc_clnt * +rpc_clone_client_set_auth_and_timeout(struct rpc_clnt *clnt, rpc_authflavor_t flavor) +{ + struct rpc_create_args args = { + .program = clnt->cl_program, + .prognumber = clnt->cl_prog, + .version = clnt->cl_vers, + .authflavor = flavor, + .timeout = clnt->cl_timeout, + }; + return __rpc_clone_client(&args, clnt); +} +EXPORT_SYMBOL_GPL(rpc_clone_client_set_auth_and_timeout); + +/** * rpc_switch_client_transport: switch the RPC transport on the fly * @clnt: pointer to a struct rpc_clnt