diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2023-06-15 20:07:30 +0200 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2023-06-19 21:08:12 +0200 |
commit | d9615d166c7ede67bf16bdd0772e35e124f305f5 (patch) | |
tree | 7e527b93c0c0ab2e63f9455bbae7d8c6a8d3d9ae /net | |
parent | NFS: add a sysfs link to the acl rpc_client (diff) | |
download | linux-d9615d166c7ede67bf16bdd0772e35e124f305f5.tar.xz linux-d9615d166c7ede67bf16bdd0772e35e124f305f5.zip |
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')
-rw-r--r-- | net/sunrpc/clnt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 640c76ab2f1a..d7c697af3762 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]++; |