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

Commit e49a29bd authored by Sachin Prabhu's avatar Sachin Prabhu Committed by Trond Myklebust
Browse files

Try using machine credentials for RENEW calls



Using user credentials for RENEW calls will fail when the user
credentials have expired.

To avoid this, try using the machine credentials when making RENEW
calls. If no machine credentials have been set, fall back to using user
credentials as before.

Signed-off-by: default avatarSachin Prabhu <sprabhu@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9390f425
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -146,6 +146,11 @@ struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp)
	struct rpc_cred *cred = NULL;
	struct rpc_cred *cred = NULL;
	struct nfs_server *server;
	struct nfs_server *server;


	/* Use machine credentials if available */
	cred = nfs4_get_machine_cred_locked(clp);
	if (cred != NULL)
		goto out;

	rcu_read_lock();
	rcu_read_lock();
	list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
	list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
		cred = nfs4_get_renew_cred_server_locked(server);
		cred = nfs4_get_renew_cred_server_locked(server);
@@ -153,6 +158,8 @@ struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp)
			break;
			break;
	}
	}
	rcu_read_unlock();
	rcu_read_unlock();

out:
	return cred;
	return cred;
}
}