NFSv4: Fix an NFSv4 mount regression
Commit 008f55d0e0
(nfs41: recover lease in
_nfs4_lookup_root) forces the state manager to always run on mount. This is
a bug in the case of NFSv4.0, which doesn't require us to send a
setclientid until we want to grab file state.
In any case, this is completely the wrong place to be doing state
management. Moving that code into nfs4_init_session...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
@@ -2040,15 +2040,9 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
|
||||
.rpc_argp = &args,
|
||||
.rpc_resp = &res,
|
||||
};
|
||||
int status;
|
||||
|
||||
nfs_fattr_init(info->fattr);
|
||||
status = nfs4_recover_expired_lease(server);
|
||||
if (!status)
|
||||
status = nfs4_check_client_ready(server->nfs_client);
|
||||
if (!status)
|
||||
status = nfs4_call_sync(server, &msg, &args, &res, 0);
|
||||
return status;
|
||||
return nfs4_call_sync(server, &msg, &args, &res, 0);
|
||||
}
|
||||
|
||||
static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
|
||||
@@ -4793,6 +4787,22 @@ int nfs4_proc_destroy_session(struct nfs4_session *session)
|
||||
return status;
|
||||
}
|
||||
|
||||
int nfs4_init_session(struct nfs_server *server)
|
||||
{
|
||||
struct nfs_client *clp = server->nfs_client;
|
||||
int ret;
|
||||
|
||||
if (!nfs4_has_session(clp))
|
||||
return 0;
|
||||
|
||||
clp->cl_session->fc_attrs.max_rqst_sz = server->wsize;
|
||||
clp->cl_session->fc_attrs.max_resp_sz = server->rsize;
|
||||
ret = nfs4_recover_expired_lease(server);
|
||||
if (!ret)
|
||||
ret = nfs4_check_client_ready(clp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Renew the cl_session lease.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user