]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nfs/nfs4state.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[karo-tx-linux.git] / fs / nfs / nfs4state.c
index 5c4286643701ce33139f5491da9402812f406533..c351e6b398388f7c1b4b09a6240d4ad6c2559295 100644 (file)
@@ -121,12 +121,13 @@ int nfs40_discover_server_trunking(struct nfs_client *clp,
                .clientid = clp->cl_clientid,
                .confirm = clp->cl_confirm,
        };
+       struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
        unsigned short port;
        int status;
 
-       port = nfs_callback_tcpport;
+       port = nn->nfs_callback_tcpport;
        if (clp->cl_addr.ss_family == AF_INET6)
-               port = nfs_callback_tcpport6;
+               port = nn->nfs_callback_tcpport6;
 
        status = nfs4_proc_setclientid(clp, NFS4_CALLBACK, port, cred, &clid);
        if (status != 0)
@@ -350,6 +351,7 @@ int nfs41_discover_server_trunking(struct nfs_client *clp,
        status = nfs4_proc_exchange_id(clp, cred);
        if (status != NFS4_OK)
                return status;
+       set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
 
        return nfs41_walk_client_list(clp, result, cred);
 }
@@ -1679,8 +1681,8 @@ out:
        return nfs4_recovery_handle_error(clp, status);
 }
 
-/* Set NFS4CLNT_LEASE_EXPIRED for all v4.0 errors and for recoverable errors
- * on EXCHANGE_ID for v4.1
+/* Set NFS4CLNT_LEASE_EXPIRED and reclaim reboot state for all v4.0 errors
+ * and for recoverable errors on EXCHANGE_ID for v4.1
  */
 static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
 {
@@ -1690,8 +1692,12 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
                        return -ESERVERFAULT;
                /* Lease confirmation error: retry after purging the lease */
                ssleep(1);
+               clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
+               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:
                pr_err("NFS: Server %s reports our clientid is in use\n",