2021-12-17 21:57:22

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH 8/9] nfsd: allow lockd to be forcibly disabled

From: Jeff Layton <[email protected]>

In some cases, we may want to use a userland NLM server which will
require that we turn off lockd.

Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Lance Shelton <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
---
fs/nfsd/nfssvc.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index ccb59e91011b..7486a6f5fc21 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -340,8 +340,19 @@ static void nfsd_shutdown_generic(void)
nfsd_file_cache_shutdown();
}

+/*
+ * Allow admin to disable lockd. This would typically be used to allow (e.g.)
+ * a userspace NLM server of some sort to be used.
+ */
+static bool nfsd_disable_lockd = false;
+module_param(nfsd_disable_lockd, bool, 0644);
+MODULE_PARM_DESC(nfsd_disable_lockd, "Allow lockd to be manually disabled.");
+
static bool nfsd_needs_lockd(struct nfsd_net *nn)
{
+ if (nfsd_disable_lockd)
+ return false;
+
return nfsd_vers(nn, 2, NFSD_TEST) || nfsd_vers(nn, 3, NFSD_TEST);
}

--
2.33.1



2021-12-18 18:07:36

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 8/9] nfsd: allow lockd to be forcibly disabled



> On Dec 17, 2021, at 4:50 PM, [email protected] wrote:
>
> From: Jeff Layton <[email protected]>
>
> In some cases, we may want to use a userland NLM server which will
> require that we turn off lockd.

Does this adminstrative interface need to be container-aware?


> Signed-off-by: Jeff Layton <[email protected]>
> Signed-off-by: Lance Shelton <[email protected]>
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
> fs/nfsd/nfssvc.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index ccb59e91011b..7486a6f5fc21 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -340,8 +340,19 @@ static void nfsd_shutdown_generic(void)
> nfsd_file_cache_shutdown();
> }
>
> +/*
> + * Allow admin to disable lockd. This would typically be used to allow (e.g.)
> + * a userspace NLM server of some sort to be used.
> + */
> +static bool nfsd_disable_lockd = false;
> +module_param(nfsd_disable_lockd, bool, 0644);
> +MODULE_PARM_DESC(nfsd_disable_lockd, "Allow lockd to be manually disabled.");
> +
> static bool nfsd_needs_lockd(struct nfsd_net *nn)
> {
> + if (nfsd_disable_lockd)
> + return false;
> +
> return nfsd_vers(nn, 2, NFSD_TEST) || nfsd_vers(nn, 3, NFSD_TEST);
> }
>
> --
> 2.33.1
>

--
Chuck Lever




2021-12-19 22:21:56

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 8/9] nfsd: allow lockd to be forcibly disabled

This seems like a really specialized requirement. Is anyone outside
hammerspace doing this?

--b.

On Fri, Dec 17, 2021 at 5:02 PM <[email protected]> wrote:
>
> From: Jeff Layton <[email protected]>
>
> In some cases, we may want to use a userland NLM server which will
> require that we turn off lockd.
>
> Signed-off-by: Jeff Layton <[email protected]>
> Signed-off-by: Lance Shelton <[email protected]>
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
> fs/nfsd/nfssvc.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index ccb59e91011b..7486a6f5fc21 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -340,8 +340,19 @@ static void nfsd_shutdown_generic(void)
> nfsd_file_cache_shutdown();
> }
>
> +/*
> + * Allow admin to disable lockd. This would typically be used to allow (e.g.)
> + * a userspace NLM server of some sort to be used.
> + */
> +static bool nfsd_disable_lockd = false;
> +module_param(nfsd_disable_lockd, bool, 0644);
> +MODULE_PARM_DESC(nfsd_disable_lockd, "Allow lockd to be manually disabled.");
> +
> static bool nfsd_needs_lockd(struct nfsd_net *nn)
> {
> + if (nfsd_disable_lockd)
> + return false;
> +
> return nfsd_vers(nn, 2, NFSD_TEST) || nfsd_vers(nn, 3, NFSD_TEST);
> }
>
> --
> 2.33.1
>