linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: mark CONFIG_NFSD_FAULT_INJECTION as deprecated
@ 2014-08-06 19:02 Jeff Layton
  2014-08-12 18:48 ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2014-08-06 19:02 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Anna.Schumaker

The fault injection code is shaky at best. If you have a lot of stateful
objects, then you can end up overflowing the client's refcount. The code
is not widely used and is starting to become a maintenance burden mark
it DEPRECATED and document that we'll remove it in v3.19.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/nfsd/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index f994e750e0d1..aad734c0b48a 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -98,11 +98,14 @@ config NFSD_V4_SECURITY_LABEL
 	For now we recommend "Y" only for developers and testers.
 
 config NFSD_FAULT_INJECTION
-	bool "NFS server manual fault injection"
+	bool "NFS server manual fault injection (DEPRECATED)"
 	depends on NFSD_V4 && DEBUG_KERNEL
 	help
 	  This option enables support for manually injecting faults
 	  into the NFS server.  This is intended to be used for
 	  testing error recovery on the NFS client.
 
+	  This feature should not be enabled on production systems
+	  and will be removed in v3.19.
+
 	  If unsure, say N.
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfsd: mark CONFIG_NFSD_FAULT_INJECTION as deprecated
  2014-08-06 19:02 [PATCH] nfsd: mark CONFIG_NFSD_FAULT_INJECTION as deprecated Jeff Layton
@ 2014-08-12 18:48 ` J. Bruce Fields
  2014-08-12 19:03   ` Jeff Layton
  0 siblings, 1 reply; 3+ messages in thread
From: J. Bruce Fields @ 2014-08-12 18:48 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs, Anna.Schumaker

On Wed, Aug 06, 2014 at 03:02:51PM -0400, Jeff Layton wrote:
> The fault injection code is shaky at best. If you have a lot of stateful
> objects, then you can end up overflowing the client's refcount. The code
> is not widely used and is starting to become a maintenance burden mark
> it DEPRECATED and document that we'll remove it in v3.19.

I doubt anyone will notice a config text change on upgrade.

If we think a deprecation warning's necessary then it would be more
useful to put it in a printk() that fires the first time somebody uses
one of these.

--b.

> 
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> ---
>  fs/nfsd/Kconfig | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
> index f994e750e0d1..aad734c0b48a 100644
> --- a/fs/nfsd/Kconfig
> +++ b/fs/nfsd/Kconfig
> @@ -98,11 +98,14 @@ config NFSD_V4_SECURITY_LABEL
>  	For now we recommend "Y" only for developers and testers.
>  
>  config NFSD_FAULT_INJECTION
> -	bool "NFS server manual fault injection"
> +	bool "NFS server manual fault injection (DEPRECATED)"
>  	depends on NFSD_V4 && DEBUG_KERNEL
>  	help
>  	  This option enables support for manually injecting faults
>  	  into the NFS server.  This is intended to be used for
>  	  testing error recovery on the NFS client.
>  
> +	  This feature should not be enabled on production systems
> +	  and will be removed in v3.19.
> +
>  	  If unsure, say N.
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfsd: mark CONFIG_NFSD_FAULT_INJECTION as deprecated
  2014-08-12 18:48 ` J. Bruce Fields
@ 2014-08-12 19:03   ` Jeff Layton
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2014-08-12 19:03 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs, Anna.Schumaker

On Tue, 12 Aug 2014 14:48:49 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> On Wed, Aug 06, 2014 at 03:02:51PM -0400, Jeff Layton wrote:
> > The fault injection code is shaky at best. If you have a lot of stateful
> > objects, then you can end up overflowing the client's refcount. The code
> > is not widely used and is starting to become a maintenance burden mark
> > it DEPRECATED and document that we'll remove it in v3.19.
> 
> I doubt anyone will notice a config text change on upgrade.
> 
> If we think a deprecation warning's necessary then it would be more
> useful to put it in a printk() that fires the first time somebody uses
> one of these.
> 
> --b.
> 
> > 
> > Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> > ---
> >  fs/nfsd/Kconfig | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
> > index f994e750e0d1..aad734c0b48a 100644
> > --- a/fs/nfsd/Kconfig
> > +++ b/fs/nfsd/Kconfig
> > @@ -98,11 +98,14 @@ config NFSD_V4_SECURITY_LABEL
> >  	For now we recommend "Y" only for developers and testers.
> >  
> >  config NFSD_FAULT_INJECTION
> > -	bool "NFS server manual fault injection"
> > +	bool "NFS server manual fault injection (DEPRECATED)"
> >  	depends on NFSD_V4 && DEBUG_KERNEL
> >  	help
> >  	  This option enables support for manually injecting faults
> >  	  into the NFS server.  This is intended to be used for
> >  	  testing error recovery on the NFS client.
> >  
> > +	  This feature should not be enabled on production systems
> > +	  and will be removed in v3.19.
> > +
> >  	  If unsure, say N.
> > -- 
> > 1.9.3
> > 

Good point. Maybe something like this patch then? The printk is a
little sparse, but I'm not sure what else we should say there...

-----------------------[snip]--------------------------

[PATCH] nfsd: mark CONFIG_NFSD_FAULT_INJECTION as deprecated

The fault injection code is shaky at best. If you have a lot of stateful
objects, then you can end up overflowing the client's refcount. The code
is not widely used and is starting to become a maintenance burden. Mark
it DEPRECATED and document that we'll remove it in v3.19.

Also add a printk that will fire once whenever someone tries to use this
facility.

Cc: Anna Schumaker <Anna.Schumaker@netapp.com>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/nfsd/Kconfig        |  5 ++++-
 fs/nfsd/fault_inject.c | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index f994e750e0d1..aad734c0b48a 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -98,11 +98,14 @@ config NFSD_V4_SECURITY_LABEL
 	For now we recommend "Y" only for developers and testers.
 
 config NFSD_FAULT_INJECTION
-	bool "NFS server manual fault injection"
+	bool "NFS server manual fault injection (DEPRECATED)"
 	depends on NFSD_V4 && DEBUG_KERNEL
 	help
 	  This option enables support for manually injecting faults
 	  into the NFS server.  This is intended to be used for
 	  testing error recovery on the NFS client.
 
+	  This feature should not be enabled on production systems
+	  and will be removed in v3.19.
+
 	  If unsure, say N.
diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c
index c16bf5af6831..91874de13ae4 100644
--- a/fs/nfsd/fault_inject.c
+++ b/fs/nfsd/fault_inject.c
@@ -24,6 +24,18 @@ struct nfsd_fault_inject_op {
 
 static struct dentry *debug_dir;
 
+static void
+warn_deprecated(void)
+{
+	static bool warned = false;
+
+	if (!warned) {
+		pr_notice("nfsd: the NFSD fault injection framework is "
+			  "scheduled for removal in v3.19.\n");
+		warned = true;
+	}
+}
+
 static ssize_t fault_inject_read(struct file *file, char __user *buf,
 				 size_t len, loff_t *ppos)
 {
@@ -33,6 +45,8 @@ static ssize_t fault_inject_read(struct file *file, char __user *buf,
 	loff_t pos = *ppos;
 	struct nfsd_fault_inject_op *op = file_inode(file)->i_private;
 
+	warn_deprecated();
+
 	if (!pos)
 		val = op->get();
 	size = scnprintf(read_buf, sizeof(read_buf), "%llu\n", val);
@@ -51,6 +65,8 @@ static ssize_t fault_inject_write(struct file *file, const char __user *buf,
 	u64 val;
 	char *nl;
 
+	warn_deprecated();
+
 	if (copy_from_user(write_buf, buf, size))
 		return -EFAULT;
 	write_buf[size] = '\0';
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-12 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 19:02 [PATCH] nfsd: mark CONFIG_NFSD_FAULT_INJECTION as deprecated Jeff Layton
2014-08-12 18:48 ` J. Bruce Fields
2014-08-12 19:03   ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).