Skip to content
Permalink
Browse files
SUNRPC: Server-side disconnect injection
Disconnect injection stress-tests the ability for both client and
server implementations to behave resiliently in the face of network
instability.

A file called /sys/kernel/debug/fail_sunrpc/ignore-server-disconnect
enables administrators to turn off server-side disconnect injection
while allowing other types of sunrpc errors to be injected. So far
there are no others. The default setting is that server-side
disconnect injection is enabled (ignore=false).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
chucklever authored and intel-lab-lkp committed Aug 10, 2021
1 parent fe621cd commit d79f2f148971c84a535defe82f0834489c4e8d62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
@@ -308,8 +308,13 @@ struct fail_sunrpc_attr fail_sunrpc = {
#if IS_ENABLED(CONFIG_FAULT_INJECTION_DEBUG_FS)
static void fail_sunrpc_init(void)
{
fault_create_debugfs_attr("fail_sunrpc", NULL,
&fail_sunrpc.attr);
struct dentry *dir;

dir = fault_create_debugfs_attr("fail_sunrpc", NULL,
&fail_sunrpc.attr);

debugfs_create_bool("ignore-server-disconnect", S_IFREG | 0600, dir,
&fail_sunrpc.ignore_server_disconnect);
}
#else
static inline void fail_sunrpc_init(void)
@@ -12,6 +12,8 @@

struct fail_sunrpc_attr {
struct fault_attr attr;

bool ignore_server_disconnect;
};

extern struct fail_sunrpc_attr fail_sunrpc;
@@ -31,6 +31,8 @@

#include <trace/events/sunrpc.h>

#include "fail.h"

#define RPCDBG_FACILITY RPCDBG_SVCDSP

static void svc_unregister(const struct svc_serv *serv, struct net *net);
@@ -1503,6 +1505,12 @@ svc_process(struct svc_rqst *rqstp)
struct svc_serv *serv = rqstp->rq_server;
u32 dir;

#if IS_ENABLED(CONFIG_FAULT_INJECTION)
if (!fail_sunrpc.ignore_server_disconnect &&
should_fail(&fail_sunrpc.attr, 1))
svc_xprt_deferred_close(rqstp->rq_xprt);
#endif

/*
* Setup response xdr_buf.
* Initially it has just one page

0 comments on commit d79f2f1

Please sign in to comment.