aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-02-01 08:40:43 -0500
committerSteve French <sfrench@us.ibm.com>2011-02-01 19:17:04 -0500
commit9587fcff42f5bece3c0a44066b079235ee73cbb3 (patch)
treed4af674931407f1ad9baf84391617eae4a6343c5 /fs/cifs
parentafe8a887550f7cc24eb16449670b93f6b43c32d8 (diff)
cifs: fix length vs. total_read confusion in cifs_demultiplex_thread
length at this point is the length returned by the last kernel_recvmsg call. total_read is the length of all of the data read so far. length is more or less meaningless at this point, so use total_read for everything. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 47d8ff623683..945b2202275f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -578,12 +578,12 @@ incomplete_rcv:
578 else if (reconnect == 1) 578 else if (reconnect == 1)
579 continue; 579 continue;
580 580
581 length += 4; /* account for rfc1002 hdr */ 581 total_read += 4; /* account for rfc1002 hdr */
582 582
583 583 dump_smb(smb_buffer, total_read);
584 dump_smb(smb_buffer, length); 584 if (checkSMB(smb_buffer, smb_buffer->Mid, total_read)) {
585 if (checkSMB(smb_buffer, smb_buffer->Mid, total_read+4)) { 585 cifs_dump_mem("Bad SMB: ", smb_buffer,
586 cifs_dump_mem("Bad SMB: ", smb_buffer, 48); 586 total_read < 48 ? total_read : 48);
587 continue; 587 continue;
588 } 588 }
589 589