Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ade33ff5 authored by Weston Andros Adamson's avatar Weston Andros Adamson Committed by Trond Myklebust
Browse files

NFSv4.1: sp4_mach_cred: no need to ref count creds



The cl_machine_cred doesn't need to be reference counted here -
a reference is held is for the lifetime of the struct nfs_client.
Also, no need to put_rpccred the rpc_message.rpc_cred.

Signed-off-by: default avatarWeston Andros Adamson <dros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 7cb852df
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -279,10 +279,10 @@ _nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode,
	if (test_bit(sp4_mode, &clp->cl_sp4_flags)) {
		spin_lock(&clp->cl_lock);
		if (clp->cl_machine_cred != NULL)
			newcred = get_rpccred(clp->cl_machine_cred);
			/* don't call get_rpccred on the machine cred -
			 * a reference will be held for life of clp */
			newcred = clp->cl_machine_cred;
		spin_unlock(&clp->cl_lock);
		if (msg->rpc_cred)
			put_rpccred(msg->rpc_cred);
		msg->rpc_cred = newcred;

		flavor = clp->cl_rpcclient->cl_auth->au_flavor;