diff options
author | Andy Adamson <andros@netapp.com> | 2009-12-15 12:55:02 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-15 13:58:42 -0500 |
commit | 68bf05efb7facbcf4a7b8d6b48a0800a90895511 (patch) | |
tree | 200e0a6b376bda123adc1b1b13d148f8bba0b896 /fs/nfs/nfs4proc.c | |
parent | a5523b84c40d34d2c30b45096fbb099b98e4b5a3 (diff) |
nfs41: fix session fore channel negotiation
If the rsize or wsize is not set on the mount command, negotiate the highest
supported rsize and wsize in session creation.
Fixes a bug where the client negotiated nfs41_maxwrite_overhead as
ca_maxrequestsize and nfs41_maxread_overhead as ca_maxresponsesize resulting
in NFS4ERR_REQ_TOO_BIG errors on writes.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index bd4555fbdf25..019a009e73a0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4935,14 +4935,22 @@ int nfs4_init_session(struct nfs_server *server) | |||
4935 | { | 4935 | { |
4936 | struct nfs_client *clp = server->nfs_client; | 4936 | struct nfs_client *clp = server->nfs_client; |
4937 | struct nfs4_session *session; | 4937 | struct nfs4_session *session; |
4938 | unsigned int rsize, wsize; | ||
4938 | int ret; | 4939 | int ret; |
4939 | 4940 | ||
4940 | if (!nfs4_has_session(clp)) | 4941 | if (!nfs4_has_session(clp)) |
4941 | return 0; | 4942 | return 0; |
4942 | 4943 | ||
4944 | rsize = server->rsize; | ||
4945 | if (rsize == 0) | ||
4946 | rsize = NFS_MAX_FILE_IO_SIZE; | ||
4947 | wsize = server->wsize; | ||
4948 | if (wsize == 0) | ||
4949 | wsize = NFS_MAX_FILE_IO_SIZE; | ||
4950 | |||
4943 | session = clp->cl_session; | 4951 | session = clp->cl_session; |
4944 | session->fc_attrs.max_rqst_sz = server->wsize + nfs41_maxwrite_overhead; | 4952 | session->fc_attrs.max_rqst_sz = wsize + nfs41_maxwrite_overhead; |
4945 | session->fc_attrs.max_resp_sz = server->rsize + nfs41_maxread_overhead; | 4953 | session->fc_attrs.max_resp_sz = rsize + nfs41_maxread_overhead; |
4946 | 4954 | ||
4947 | ret = nfs4_recover_expired_lease(server); | 4955 | ret = nfs4_recover_expired_lease(server); |
4948 | if (!ret) | 4956 | if (!ret) |