Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"eguan@linux.alibaba.com" <eguan@linux.alibaba.com>
Subject: Re: [PATCH 1/2] nfs: hornor timeo and retrans option when mounting NFSv3
Date: Mon, 22 Mar 2021 15:53:01 +0000	[thread overview]
Message-ID: <5b0d0bf03b7bcb1562588aa8137df22964a246db.camel@hammerspace.com> (raw)
In-Reply-To: <20210322052904.83508-1-eguan@linux.alibaba.com>

On Mon, 2021-03-22 at 13:29 +0800, Eryu Guan wrote:
> Mounting NFSv3 uses default timeout parameters specified by underlying
> sunrpc transport, and mount options like 'timeo' and 'retrans', unlike
> NFSv4, are not honored.
> 
> But sometimes we want to set non-default timeout value when mounting
> NFSv3, so pass 'timeo' and 'retrans' to nfs_mount() and fill the
> 'timeout' field of struct rpc_create_args before creating RPC
> connection. This is also consistent with NFSv4 behavior.
> 
> Note that this only sets the timeout value of rpc connection to mountd,
> but the timeout of rpcbind connection should be set as well. A later
> patch will fix the rpcbind part.
> 
> Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
> ---
>  fs/nfs/internal.h   |  2 +-
>  fs/nfs/mount_clnt.c | 12 +++++++-----
>  fs/nfs/super.c      |  2 +-
>  3 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index 7b644d6c09e4..cf0d7db24d44 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -180,7 +180,7 @@ struct nfs_mount_request {
>         struct net              *net;
>  };
>  
> -extern int nfs_mount(struct nfs_mount_request *info);
> +extern int nfs_mount(struct nfs_mount_request *info, int timeo, int
> retrans);
>  extern void nfs_umount(const struct nfs_mount_request *info);
>  
>  /* client.c */
> diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
> index dda5c3e65d8d..248319254672 100644
> --- a/fs/nfs/mount_clnt.c
> +++ b/fs/nfs/mount_clnt.c
> @@ -137,13 +137,13 @@ struct mnt_fhstatus {
>   * nfs_mount - Obtain an NFS file handle for the given host and path
>   * @info: pointer to mount request arguments
>   *
> - * Uses default timeout parameters specified by underlying transport.
> On
> - * successful return, the auth_flavs list and auth_flav_len will be
> populated
> - * with the list from the server or a faked-up list if the server
> didn't
> - * provide one.
> + * Uses timeout parameters specified by caller. On successful return,
> the
> + * auth_flavs list and auth_flav_len will be populated with the list
> from the
> + * server or a faked-up list if the server didn't provide one.
>   */
> -int nfs_mount(struct nfs_mount_request *info)
> +int nfs_mount(struct nfs_mount_request *info, int timeo, int retrans)


fs/nfs/mount_clnt.c:145: warning: Function parameter or member 'timeo'
not described in 'nfs_mount'
fs/nfs/mount_clnt.c:145: warning: Function parameter or member
'retrans' not described in 'nfs_mount'


-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  parent reply	other threads:[~2021-03-22 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22  5:29 [PATCH 1/2] nfs: hornor timeo and retrans option when mounting NFSv3 Eryu Guan
2021-03-22  5:29 ` [PATCH 2/2] sunrpc: honor rpc_task's timeout value in rpcb_create() Eryu Guan
2021-03-22 15:53 ` Trond Myklebust [this message]
2021-03-23  2:57   ` [PATCH 1/2] nfs: hornor timeo and retrans option when mounting NFSv3 Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b0d0bf03b7bcb1562588aa8137df22964a246db.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=eguan@linux.alibaba.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox