summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2017-03-08 14:39:15 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 10:07:26 +0100
commit5d460d359abefe59e1cac738d37296f3cd4bc1f8 (patch)
treedc6a5ca0c3ef25d782eec93cef33f3f95e9e0531
parent88af4e34771c88a09ed722bbf4346a2ddfee6dbe (diff)
downloadlinux-stable-5d460d359abefe59e1cac738d37296f3cd4bc1f8.tar.gz
linux-stable-5d460d359abefe59e1cac738d37296f3cd4bc1f8.tar.bz2
linux-stable-5d460d359abefe59e1cac738d37296f3cd4bc1f8.zip
NFSv4.1 respect server's max size in CREATE_SESSION
[ Upstream commit 033853325fe3bdc70819a8b97915bd3bca41d3af ] Currently client doesn't respect max sizes server returns in CREATE_SESSION. nfs4_session_set_rwsize() gets called and server->rsize, server->wsize are 0 so they never get set to the sizes returned by the server. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/nfs/nfs4client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 074ac7131459..f6b0848cc831 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -1004,9 +1004,9 @@ static void nfs4_session_set_rwsize(struct nfs_server *server)
server_resp_sz = sess->fc_attrs.max_resp_sz - nfs41_maxread_overhead;
server_rqst_sz = sess->fc_attrs.max_rqst_sz - nfs41_maxwrite_overhead;
- if (server->rsize > server_resp_sz)
+ if (!server->rsize || server->rsize > server_resp_sz)
server->rsize = server_resp_sz;
- if (server->wsize > server_rqst_sz)
+ if (!server->wsize || server->wsize > server_rqst_sz)
server->wsize = server_rqst_sz;
#endif /* CONFIG_NFS_V4_1 */
}