summaryrefslogtreecommitdiffstats
path: root/fs/cifs/transport.c
diff options
context:
space:
mode:
authorRonnie Sahlberg2018-03-31 02:45:31 +0200
committerSteve French2018-04-02 20:09:44 +0200
commit93012bf984163f6616d1ab606a7cd86095c052c6 (patch)
tree5f72bd3f1e727d2e1d85a33be1a95cc5ab350971 /fs/cifs/transport.c
parentcifs: smbd: disconnect transport on RDMA errors (diff)
downloadkernel-qcow2-linux-93012bf984163f6616d1ab606a7cd86095c052c6.tar.gz
kernel-qcow2-linux-93012bf984163f6616d1ab606a7cd86095c052c6.tar.xz
kernel-qcow2-linux-93012bf984163f6616d1ab606a7cd86095c052c6.zip
cifs: add server->vals->header_preamble_size
This variable is set to 4 for all protocol versions and replaces the hardcoded constant 4 throughought the code. This will later be updated to reflect whether a response packet has a 4 byte length preamble or not once we start removing this field from the SMB2+ dialects. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r--fs/cifs/transport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 665661464067..279718dcb2ed 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -790,7 +790,8 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
buf = (char *)midQ->resp_buf;
resp_iov->iov_base = buf;
- resp_iov->iov_len = get_rfc1002_length(buf) + 4;
+ resp_iov->iov_len = get_rfc1002_length(buf) +
+ ses->server->vals->header_preamble_size;
if (midQ->large_buf)
*resp_buf_type = CIFS_LARGE_BUFFER;
else