]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfs/nfs4renewd.c
NFSv4: Clean up nfs_expire_all_delegations()
[linux-2.6-omap-h63xx.git] / fs / nfs / nfs4renewd.c
index 6101f955f231a1a6ca627ebbddd4f89a683d0b6d..ca557e677d9ed56965af7eb7f14ad62583c08eb9 100644 (file)
@@ -77,16 +77,18 @@ nfs4_renew_state(struct work_struct *work)
        /* Are we close to a lease timeout? */
        if (time_after(now, last + lease/3)) {
                cred = nfs4_get_renew_cred_locked(clp);
+               spin_unlock(&clp->cl_lock);
                if (cred == NULL) {
-                       set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
-                       spin_unlock(&clp->cl_lock);
+                       if (list_empty(&clp->cl_delegations)) {
+                               set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
+                               goto out;
+                       }
                        nfs_expire_all_delegations(clp);
-                       goto out;
+               } else {
+                       /* Queue an asynchronous RENEW. */
+                       nfs4_proc_async_renew(clp, cred);
+                       put_rpccred(cred);
                }
-               spin_unlock(&clp->cl_lock);
-               /* Queue an asynchronous RENEW. */
-               nfs4_proc_async_renew(clp, cred);
-               put_rpccred(cred);
                timeout = (2 * lease) / 3;
                spin_lock(&clp->cl_lock);
        } else