From: Sachin Prabhu Date: Fri, 16 Mar 2012 19:25:52 +0000 (+0000) Subject: Try using machine credentials for RENEW calls X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e49a29bd0eacce9d4956c4daf777a330115b369d;p=mv-sheeva.git 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: Sachin Prabhu Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 119006b0815..12b068f2ec9 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -146,6 +146,11 @@ struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp) struct rpc_cred *cred = NULL; struct nfs_server *server; + /* Use machine credentials if available */ + cred = nfs4_get_machine_cred_locked(clp); + if (cred != NULL) + goto out; + rcu_read_lock(); list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { 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; } rcu_read_unlock(); + +out: return cred; }