From: "J.;Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Kinglong Mee <kinglongmee@gmail.com>,
Gareth Williams <gareth@garethwilliams.me.uk>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: Question ref Running NFS at V4 Only
Date: Fri, 27 Dec 2013 13:43:09 -0500 [thread overview]
Message-ID: <20131227184309.GA9161@fieldses.org> (raw)
In-Reply-To: <7FD776EA-EAA8-41E0-9567-BF3924D365AC@oracle.com>
On Fri, Dec 27, 2013 at 11:05:05AM -0500, Chuck Lever wrote:
> Hi-
>
> On Dec 27, 2013, at 5:17 AM, Kinglong Mee <kinglongmee@gmail.com> wrote:
>
> > On 12/24/2013 01:39 AM, J. Bruce Fields wrote:
> >> On Fri, Dec 20, 2013 at 05:10:42PM +0000, Gareth Williams wrote:
> >>> Hi,
> >>>
> >>> I'm trying to run NFS with protocol version 4 only (that is, with v2
> >>> & v3 disabled) on a CentOS 6.5 install running as a KVM guest.
> >>>
> >>> The RedHat documentation (amongst others) states that rpcbind isn't
> >>> needed with v4, but if I start nfs without rpcbind I get errors.
> >>
> >> I suspect the kernel code needs to be fixed to not attempt to register
> >> with rpcbind n the v4-only case. (Or to attempt to register but ignore
> >> any error, I'm not sure which is best.)
> >>
> >> And this may not be the only issue in the v4-only case. This isn't
> >> really a priority for me right now, but I'd happily look at patches.
> >
> > Hi all,
> >
> > I make a patch for this problem, please have a check, thanks.
> >
> > From 64c1f96348213f39b9411ab25699a292edbef4ef Mon Sep 17 00:00:00 2001
> > From: Kinglong Mee <kinglongmee@gmail.com>
> > Date: Fri, 27 Dec 2013 18:06:25 +0800
> > Subject: [PATCH] NFSD: supports nfsv4 service without rpcbind
> >
> > 1. set vs_hidden in nfsd_version4 to avoid register nfsv4 to rpcbind
>
> IMO we do want the NFS port registered if rpcbind is running. NFSv4 is not a hidden service, like the client's callback server which can only be discovered by a forward advertisement (SETCLIENTID).
>
> I think I prefer ignoring the rpcb_set error for NFSv4.
Agreed. My only concern would be that there be no unnecessary delays or
errors logged in the v4-only case if rpcbind isn't running.
--b.
>
>
> > 2. don't start lockd when only supports nfsv4.
> >
> > Reported-by: Gareth Williams <gareth@garethwilliams.me.uk>
> > Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> > ---
> > fs/nfsd/netns.h | 3 +++
> > fs/nfsd/nfs4proc.c | 1 +
> > fs/nfsd/nfsctl.c | 3 +++
> > fs/nfsd/nfssvc.c | 21 ++++++++++++++++-----
> > 4 files changed, 23 insertions(+), 5 deletions(-)
> >
> > diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
> > index 849a7c3..ae2c179 100644
> > --- a/fs/nfsd/netns.h
> > +++ b/fs/nfsd/netns.h
> > @@ -96,6 +96,9 @@ struct nfsd_net {
> >
> > bool nfsd_net_up;
> >
> > + bool lockd_up;
> > + u32 nfsd_needs_lockd;
> > +
> > /*
> > * Time of server startup
> > */
> > diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> > index 419572f..1496376 100644
> > --- a/fs/nfsd/nfs4proc.c
> > +++ b/fs/nfsd/nfs4proc.c
> > @@ -1881,6 +1881,7 @@ struct svc_version nfsd_version4 = {
> > .vs_proc = nfsd_procedures4,
> > .vs_dispatch = nfsd_dispatch,
> > .vs_xdrsize = NFS4_SVC_XDRSIZE,
> > + .vs_hidden = 1,
> > };
> >
> > /*
> > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> > index 7f55517..8c7b0f0 100644
> > --- a/fs/nfsd/nfsctl.c
> > +++ b/fs/nfsd/nfsctl.c
> > @@ -575,6 +575,9 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
> > switch(num) {
> > case 2:
> > case 3:
> > + nfsd_vers(num, sign == '-' ? NFSD_CLEAR : NFSD_SET);
> > + nn->nfsd_needs_lockd = nfsd_vers(num, NFSD_TEST);
> > + break;
> > case 4:
> > nfsd_vers(num, sign == '-' ? NFSD_CLEAR : NFSD_SET);
> > break;
> > diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> > index 760c85a..2b841d8 100644
> > --- a/fs/nfsd/nfssvc.c
> > +++ b/fs/nfsd/nfssvc.c
> > @@ -255,9 +255,14 @@ static int nfsd_startup_net(int nrservs, struct net *net)
> > ret = nfsd_init_socks(net);
> > if (ret)
> > goto out_socks;
> > - ret = lockd_up(net);
> > - if (ret)
> > - goto out_socks;
> > +
> > + if (nn->nfsd_needs_lockd && !nn->lockd_up) {
> > + ret = lockd_up(net);
> > + if (ret)
> > + goto out_socks;
> > + nn->lockd_up = 1;
> > + }
> > +
> > ret = nfs4_state_start_net(net);
> > if (ret)
> > goto out_lockd;
> > @@ -266,7 +271,10 @@ static int nfsd_startup_net(int nrservs, struct net *net)
> > return 0;
> >
> > out_lockd:
> > - lockd_down(net);
> > + if (nn->lockd_up) {
> > + lockd_down(net);
> > + nn->lockd_up = 0;
> > + }
> > out_socks:
> > nfsd_shutdown_generic();
> > return ret;
> > @@ -277,7 +285,10 @@ static void nfsd_shutdown_net(struct net *net)
> > struct nfsd_net *nn = net_generic(net, nfsd_net_id);
> >
> > nfs4_state_shutdown_net(net);
> > - lockd_down(net);
> > + if (nn->lockd_up) {
> > + lockd_down(net);
> > + nn->lockd_up = 0;
> > + }
> > nn->nfsd_net_up = false;
> > nfsd_shutdown_generic();
> > }
> > --
> > 1.8.4.2
> >
> >
> > --
> > 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
>
> --
> Chuck Lever
> chuck[dot]lever[at]oracle[dot]com
>
>
>
>
next prev parent reply other threads:[~2013-12-27 18:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 17:10 Question ref Running NFS at V4 Only Gareth Williams
2013-12-23 17:39 ` J. Bruce Fields
2013-12-27 10:17 ` Kinglong Mee
2013-12-27 16:05 ` Chuck Lever
2013-12-27 18:43 ` J.;Bruce Fields [this message]
2013-12-27 19:40 ` Chuck Lever
[not found] ` <6E281EC9-49CB-4BDA-BDF3-7A6F4B703156@gmail.com>
2013-12-29 6:39 ` Kinglong Mee
[not found] ` <5D65FDE6-D1AB-442C-BFD8-141AB87FF321@gmail.com>
2013-12-29 9:11 ` Kinglong Mee
2013-12-30 11:22 ` Kinglong Mee
2013-12-30 11:24 ` [PATCH 1/2] SUNRPC: supports ignoring error from svc_register Kinglong Mee
2013-12-30 11:25 ` [PATCH 2/2] NFSD: supports nfsv4 service without rpcbind Kinglong Mee
2013-12-30 17:54 ` Chuck Lever
2013-12-31 3:18 ` Kinglong Mee
2013-12-31 5:17 ` [PATCH 1/2 v2] SUNRPC/NFSD: Supports new option for ignoring the result of svc_register Kinglong Mee
2013-12-31 5:17 ` [PATCH 2/2 v2] NFSD: Don't start lockd when only NFSv4 is running Kinglong Mee
2014-01-03 23:18 ` J.,Bruce Fields
2014-01-06 3:28 ` NFSD: fix compile warning without CONFIG_NFSD_V3 Kinglong Mee
2014-01-06 18:44 ` J.,Bruce Fields
2013-12-31 19:39 ` [PATCH 1/4] SUNRPC: Ensure xprt_connect_status handles all potential connection errors Trond Myklebust
2013-12-31 19:39 ` [PATCH 2/4] SUNRPC: Handle connect errors ECONNABORTED and EHOSTUNREACH Trond Myklebust
2013-12-31 19:39 ` [PATCH 3/4] SUNRPC: Report connection error values to rpc_tasks on the pending queue Trond Myklebust
2013-12-31 19:39 ` [PATCH 4/4] SUNRPC: Add tracepoint for socket errors Trond Myklebust
2014-01-05 19:54 ` J. Bruce Fields
2014-01-05 20:19 ` Trond Myklebust
2014-01-02 4:52 ` [PATCH 1/4] SUNRPC: Ensure xprt_connect_status handles all potential connection errors Kinglong Mee
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=20131227184309.GA9161@fieldses.org \
--to=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=gareth@garethwilliams.me.uk \
--cc=kinglongmee@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.