Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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. The
default setting is that server-side disconnect injection is enabled
(ignore=false).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+13
+3
net/sunrpc/debugfs.c
··· 259 259 260 260 debugfs_create_bool("ignore-client-disconnect", S_IFREG | 0600, dir, 261 261 &fail_sunrpc.ignore_client_disconnect); 262 + 263 + debugfs_create_bool("ignore-server-disconnect", S_IFREG | 0600, dir, 264 + &fail_sunrpc.ignore_server_disconnect); 262 265 } 263 266 #else 264 267 static void fail_sunrpc_init(void)
+2
net/sunrpc/fail.h
··· 14 14 struct fault_attr attr; 15 15 16 16 bool ignore_client_disconnect; 17 + 18 + bool ignore_server_disconnect; 17 19 }; 18 20 19 21 extern struct fail_sunrpc_attr fail_sunrpc;
+8
net/sunrpc/svc.c
··· 31 31 32 32 #include <trace/events/sunrpc.h> 33 33 34 + #include "fail.h" 35 + 34 36 #define RPCDBG_FACILITY RPCDBG_SVCDSP 35 37 36 38 static void svc_unregister(const struct svc_serv *serv, struct net *net); ··· 1525 1523 struct kvec *resv = &rqstp->rq_res.head[0]; 1526 1524 struct svc_serv *serv = rqstp->rq_server; 1527 1525 u32 dir; 1526 + 1527 + #if IS_ENABLED(CONFIG_FAIL_SUNRPC) 1528 + if (!fail_sunrpc.ignore_server_disconnect && 1529 + should_fail(&fail_sunrpc.attr, 1)) 1530 + svc_xprt_deferred_close(rqstp->rq_xprt); 1531 + #endif 1528 1532 1529 1533 /* 1530 1534 * Setup response xdr_buf.