Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[deliverable/linux.git] / fs / nfs / nfs4state.c
index 22fe35104c0c1cb30b1d1a27c9996380710a00c6..5194933ed419c140d6d5089406def6657683785e 100644 (file)
@@ -1705,7 +1705,8 @@ restart:
                        if (status < 0) {
                                set_bit(ops->owner_flag_bit, &sp->so_flags);
                                nfs4_put_state_owner(sp);
-                               return nfs4_recovery_handle_error(clp, status);
+                               status = nfs4_recovery_handle_error(clp, status);
+                               return (status != 0) ? status : -EAGAIN;
                        }
 
                        nfs4_put_state_owner(sp);
@@ -1714,7 +1715,7 @@ restart:
                spin_unlock(&clp->cl_lock);
        }
        rcu_read_unlock();
-       return status;
+       return 0;
 }
 
 static int nfs4_check_lease(struct nfs_client *clp)
@@ -1761,7 +1762,6 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
                break;
        case -NFS4ERR_STALE_CLIENTID:
                clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
-               nfs4_state_clear_reclaim_reboot(clp);
                nfs4_state_start_reclaim_reboot(clp);
                break;
        case -NFS4ERR_CLID_INUSE:
@@ -2345,6 +2345,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
                        status = nfs4_check_lease(clp);
                        if (status < 0)
                                goto out_error;
+                       continue;
                }
 
                if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
@@ -2366,14 +2367,11 @@ static void nfs4_state_manager(struct nfs_client *clp)
                        section = "reclaim reboot";
                        status = nfs4_do_reclaim(clp,
                                clp->cl_mvops->reboot_recovery_ops);
-                       if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) ||
-                           test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state))
-                               continue;
-                       nfs4_state_end_reclaim_reboot(clp);
-                       if (test_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state))
+                       if (status == -EAGAIN)
                                continue;
                        if (status < 0)
                                goto out_error;
+                       nfs4_state_end_reclaim_reboot(clp);
                }
 
                /* Now recover expired state... */
@@ -2381,9 +2379,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
                        section = "reclaim nograce";
                        status = nfs4_do_reclaim(clp,
                                clp->cl_mvops->nograce_recovery_ops);
-                       if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) ||
-                           test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) ||
-                           test_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state))
+                       if (status == -EAGAIN)
                                continue;
                        if (status < 0)
                                goto out_error;
This page took 0.031631 seconds and 5 git commands to generate.