aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4callback.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-02-05 09:57:07 +0800
committerJ. Bruce Fields <bfields@redhat.com>2017-02-17 16:26:00 -0500
commitf7d1ddbe7648af7460d23688c8c131342eb43b3a (patch)
treefc2e10cdd756b1233e91594117cd6148bc84feb2 /fs/nfsd/nfs4callback.c
parentnfsd/idmap: return nfserr_inval for 0-length names (diff)
downloadlinux-dev-f7d1ddbe7648af7460d23688c8c131342eb43b3a.tar.xz
linux-dev-f7d1ddbe7648af7460d23688c8c131342eb43b3a.zip
nfsd/callback: Cleanup callback cred on shutdown
The rpccred gotten from rpc_lookup_machine_cred() should be put when state is shutdown. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r--fs/nfsd/nfs4callback.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index eb78109d666c..fb6ca0ace9b1 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -753,6 +753,14 @@ int set_callback_cred(void)
return 0;
}
+void cleanup_callback_cred(void)
+{
+ if (callback_cred) {
+ put_rpccred(callback_cred);
+ callback_cred = NULL;
+ }
+}
+
static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, struct nfsd4_session *ses)
{
if (clp->cl_minorversion == 0) {