]> err.no Git - linux-2.6/blobdiff - fs/nfs/nfs4renewd.c
[PATCH] smbfs: Fix slab corruption in samba error path
[linux-2.6] / fs / nfs / nfs4renewd.c
index f62c2f7a4ffbda8717d037a57f5f3b17cfbbd6c5..5d764d8e6d8ac5ab6eff0efd86b03a55a8c1a16d 100644 (file)
@@ -62,6 +62,7 @@ void
 nfs4_renew_state(void *data)
 {
        struct nfs4_client *clp = (struct nfs4_client *)data;
+       struct rpc_cred *cred;
        long lease, timeout;
        unsigned long last, now;
 
@@ -77,7 +78,8 @@ nfs4_renew_state(void *data)
        timeout = (2 * lease) / 3 + (long)last - (long)now;
        /* Are we close to a lease timeout? */
        if (time_after(now, last + lease/3)) {
-               if (list_empty(&clp->cl_state_owners)) {
+               cred = nfs4_get_renew_cred(clp);
+               if (cred == NULL) {
                        set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
                        spin_unlock(&clp->cl_lock);
                        nfs_expire_all_delegations(clp);
@@ -85,7 +87,8 @@ nfs4_renew_state(void *data)
                }
                spin_unlock(&clp->cl_lock);
                /* Queue an asynchronous RENEW. */
-               nfs4_proc_async_renew(clp);
+               nfs4_proc_async_renew(clp, cred);
+               put_rpccred(cred);
                timeout = (2 * lease) / 3;
                spin_lock(&clp->cl_lock);
        } else