aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r--fs/nfsd/nfs4callback.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index c17a5202ee3f..c1cb7e009c1e 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -344,28 +344,6 @@ static struct rpc_version * nfs_cb_version[] = {
344 &nfs_cb_version4, 344 &nfs_cb_version4,
345}; 345};
346 346
347/*
348 * Use the SETCLIENTID credential
349 */
350static struct rpc_cred *
351nfsd4_lookupcred(struct nfs4_client *clp, int taskflags)
352{
353 struct auth_cred acred;
354 struct rpc_clnt *clnt = clp->cl_callback.cb_client;
355 struct rpc_cred *ret;
356
357 get_group_info(clp->cl_cred.cr_group_info);
358 acred.uid = clp->cl_cred.cr_uid;
359 acred.gid = clp->cl_cred.cr_gid;
360 acred.group_info = clp->cl_cred.cr_group_info;
361
362 dprintk("NFSD: looking up %s cred\n",
363 clnt->cl_auth->au_ops->au_name);
364 ret = rpcauth_lookup_credcache(clnt->cl_auth, &acred, taskflags);
365 put_group_info(clp->cl_cred.cr_group_info);
366 return ret;
367}
368
369/* Reference counting, callback cleanup, etc., all look racy as heck. 347/* Reference counting, callback cleanup, etc., all look racy as heck.
370 * And why is cb_set an atomic? */ 348 * And why is cb_set an atomic? */
371 349
@@ -379,18 +357,13 @@ static int do_probe_callback(void *data)
379 }; 357 };
380 int status; 358 int status;
381 359
382 msg.rpc_cred = nfsd4_lookupcred(clp, 0);
383 if (IS_ERR(msg.rpc_cred))
384 goto out;
385 status = rpc_call_sync(cb->cb_client, &msg, RPC_TASK_SOFT); 360 status = rpc_call_sync(cb->cb_client, &msg, RPC_TASK_SOFT);
386 put_rpccred(msg.rpc_cred);
387 361
388 if (status) { 362 if (status) {
389 rpc_shutdown_client(cb->cb_client); 363 rpc_shutdown_client(cb->cb_client);
390 cb->cb_client = NULL; 364 cb->cb_client = NULL;
391 } else 365 } else
392 atomic_set(&cb->cb_set, 1); 366 atomic_set(&cb->cb_set, 1);
393out:
394 put_nfs4_client(clp); 367 put_nfs4_client(clp);
395 return 0; 368 return 0;
396} 369}
@@ -488,10 +461,6 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
488 if ((!atomic_read(&clp->cl_callback.cb_set)) || !clnt) 461 if ((!atomic_read(&clp->cl_callback.cb_set)) || !clnt)
489 return; 462 return;
490 463
491 msg.rpc_cred = nfsd4_lookupcred(clp, 0);
492 if (IS_ERR(msg.rpc_cred))
493 goto out;
494
495 cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */ 464 cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */
496 cbr->cbr_dp = dp; 465 cbr->cbr_dp = dp;
497 466
@@ -512,8 +481,6 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
512 status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT); 481 status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT);
513 } 482 }
514out_put_cred: 483out_put_cred:
515 put_rpccred(msg.rpc_cred);
516out:
517 if (status == -EIO) 484 if (status == -EIO)
518 atomic_set(&clp->cl_callback.cb_set, 0); 485 atomic_set(&clp->cl_callback.cb_set, 0);
519 /* Success or failure, now we're either waiting for lease expiration 486 /* Success or failure, now we're either waiting for lease expiration