]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Try using machine credentials for RENEW calls
authorSachin Prabhu <sprabhu@redhat.com>
Fri, 16 Mar 2012 19:25:52 +0000 (19:25 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 17 Mar 2012 15:17:42 +0000 (11:17 -0400)
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 <sprabhu@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4state.c

index 119006b0815ab4707ee788a26f9b44d5366c9d51..12b068f2ec91a2d95d8b47dce9438b02a652bd3a 100644 (file)
@@ -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;
 }