summaryrefslogtreecommitdiff
path: root/net/sunrpc/debugfs.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2021-08-03 15:45:18 -0400
committerChuck Lever <chuck.lever@oracle.com>2021-08-20 13:50:32 -0400
commitc782af250083f69ba810e79b60a552252e777416 (patch)
tree3bfbcc4a3d9662303c157e38c868944f5e41581e /net/sunrpc/debugfs.c
parent729580ddc53efd8093371788721487024c9b2f71 (diff)
SUNRPC: Add a /sys/kernel/debug/fail_sunrpc/ directory
This directory will contain a set of administrative controls for enabling error injection for kernel RPC consumers. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net/sunrpc/debugfs.c')
-rw-r--r--net/sunrpc/debugfs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/sunrpc/debugfs.c b/net/sunrpc/debugfs.c
index 56029e3af6ff..eaeb51f83abd 100644
--- a/net/sunrpc/debugfs.c
+++ b/net/sunrpc/debugfs.c
@@ -8,7 +8,9 @@
#include <linux/debugfs.h>
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/clnt.h>
+
#include "netns.h"
+#include "fail.h"
static struct dentry *topdir;
static struct dentry *rpc_clnt_dir;
@@ -297,6 +299,13 @@ static const struct file_operations fault_disconnect_fops = {
.release = fault_release,
};
+#if IS_ENABLED(CONFIG_FAIL_SUNRPC)
+struct fail_sunrpc_attr fail_sunrpc = {
+ .attr = FAULT_ATTR_INITIALIZER,
+};
+EXPORT_SYMBOL_GPL(fail_sunrpc);
+#endif
+
void __exit
sunrpc_debugfs_exit(void)
{
@@ -321,4 +330,9 @@ sunrpc_debugfs_init(void)
debugfs_create_file("disconnect", S_IFREG | 0400, rpc_fault_dir, NULL,
&fault_disconnect_fops);
+
+#if IS_ENABLED(CONFIG_FAIL_SUNRPC)
+ fault_create_debugfs_attr("fail_sunrpc", NULL,
+ &fail_sunrpc.attr);
+#endif
}