cifs: remove rfc1002 hardcoded constants from cifs_discard_remaining_data()
authorRonnie Sahlberg <lsahlber@redhat.com>
Mon, 9 Apr 2018 08:06:31 +0000 (18:06 +1000)
committerSteve French <smfrench@gmail.com>
Fri, 13 Apr 2018 01:32:53 +0000 (20:32 -0500)
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/cifssmb.c

index 890b3a40c79ca5309feb1ff86ae66037fb7433fd..6d3e40d7029c47c6abd7264e8a8aa0cf526f4ee5 100644 (file)
@@ -1418,8 +1418,9 @@ openRetry:
 int
 cifs_discard_remaining_data(struct TCP_Server_Info *server)
 {
-       unsigned int rfclen = get_rfc1002_length(server->smallbuf);
-       int remaining = rfclen + 4 - server->total_read;
+       unsigned int rfclen = server->pdu_size;
+       int remaining = rfclen + server->vals->header_preamble_size -
+               server->total_read;
 
        while (remaining > 0) {
                int length;