Commit ae72ae67 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Don't confuse CREATE_SESSION arguments and results

Don't store the target request and response sizes in the same
variables used to store the server's replies to those targets.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 5df904ae
...@@ -5807,8 +5807,8 @@ void nfs4_destroy_session(struct nfs4_session *session) ...@@ -5807,8 +5807,8 @@ void nfs4_destroy_session(struct nfs4_session *session)
static void nfs4_init_channel_attrs(struct nfs41_create_session_args *args) static void nfs4_init_channel_attrs(struct nfs41_create_session_args *args)
{ {
struct nfs4_session *session = args->client->cl_session; struct nfs4_session *session = args->client->cl_session;
unsigned int mxrqst_sz = session->fc_attrs.max_rqst_sz, unsigned int mxrqst_sz = session->fc_target_max_rqst_sz,
mxresp_sz = session->fc_attrs.max_resp_sz; mxresp_sz = session->fc_target_max_resp_sz;
if (mxrqst_sz == 0) if (mxrqst_sz == 0)
mxrqst_sz = NFS_MAX_FILE_IO_SIZE; mxrqst_sz = NFS_MAX_FILE_IO_SIZE;
...@@ -6015,24 +6015,28 @@ int nfs4_init_session(struct nfs_server *server) ...@@ -6015,24 +6015,28 @@ int nfs4_init_session(struct nfs_server *server)
{ {
struct nfs_client *clp = server->nfs_client; struct nfs_client *clp = server->nfs_client;
struct nfs4_session *session; struct nfs4_session *session;
unsigned int rsize, wsize; unsigned int target_max_rqst_sz = NFS_MAX_FILE_IO_SIZE;
unsigned int target_max_resp_sz = NFS_MAX_FILE_IO_SIZE;
if (!nfs4_has_session(clp)) if (!nfs4_has_session(clp))
return 0; return 0;
if (server->rsize != 0)
target_max_resp_sz = server->rsize;
target_max_resp_sz += nfs41_maxread_overhead;
if (server->wsize != 0)
target_max_rqst_sz = server->wsize;
target_max_rqst_sz += nfs41_maxwrite_overhead;
session = clp->cl_session; session = clp->cl_session;
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
if (test_and_clear_bit(NFS4_SESSION_INITING, &session->session_state)) { if (test_and_clear_bit(NFS4_SESSION_INITING, &session->session_state)) {
/* Initialise targets and channel attributes */
rsize = server->rsize; session->fc_target_max_rqst_sz = target_max_rqst_sz;
if (rsize == 0) session->fc_attrs.max_rqst_sz = target_max_rqst_sz;
rsize = NFS_MAX_FILE_IO_SIZE; session->fc_target_max_resp_sz = target_max_resp_sz;
wsize = server->wsize; session->fc_attrs.max_resp_sz = target_max_resp_sz;
if (wsize == 0)
wsize = NFS_MAX_FILE_IO_SIZE;
session->fc_attrs.max_rqst_sz = wsize + nfs41_maxwrite_overhead;
session->fc_attrs.max_resp_sz = rsize + nfs41_maxread_overhead;
} }
spin_unlock(&clp->cl_lock); spin_unlock(&clp->cl_lock);
......
...@@ -242,6 +242,9 @@ struct nfs4_session { ...@@ -242,6 +242,9 @@ struct nfs4_session {
struct nfs4_channel_attrs bc_attrs; struct nfs4_channel_attrs bc_attrs;
struct nfs4_slot_table bc_slot_table; struct nfs4_slot_table bc_slot_table;
struct nfs_client *clp; struct nfs_client *clp;
/* Create session arguments */
unsigned int fc_target_max_rqst_sz;
unsigned int fc_target_max_resp_sz;
}; };
#endif /* CONFIG_NFS_V4 */ #endif /* CONFIG_NFS_V4 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment