aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorBenjamin Coddington <bcodding@redhat.com>2023-06-15 14:07:30 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2023-06-19 15:08:12 -0400
commitd9615d166c7ede67bf16bdd0772e35e124f305f5 (patch)
tree7e527b93c0c0ab2e63f9455bbae7d8c6a8d3d9ae /net/sunrpc
parentf4057ffd0e134e54a727e00c3c9b0d9a5051eadf (diff)
downloadlinux-d9615d166c7ede67bf16bdd0772e35e124f305f5.tar.gz
NFS: add sysfs shutdown knob
Within each nfs_server sysfs tree, add an entry named "shutdown". Writing 1 to this file will set the cl_shutdown bit on the rpc_clnt structs associated with that mount. If cl_shutdown is set, the task scheduler immediately returns -EIO for new tasks. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 640c76ab2f1af..d7c697af3762f 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1724,6 +1724,11 @@ call_start(struct rpc_task *task)
trace_rpc_request(task);
+ if (task->tk_client->cl_shutdown) {
+ rpc_call_rpcerror(task, -EIO);
+ return;
+ }
+
/* Increment call count (version might not be valid for ping) */
if (clnt->cl_program->version[clnt->cl_vers])
clnt->cl_program->version[clnt->cl_vers]->counts[idx]++;