diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 47d8ff623683..257b6d895e20 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -337,8 +337,12 @@ cifs_echo_request(struct work_struct *work) | |||
337 | struct TCP_Server_Info *server = container_of(work, | 337 | struct TCP_Server_Info *server = container_of(work, |
338 | struct TCP_Server_Info, echo.work); | 338 | struct TCP_Server_Info, echo.work); |
339 | 339 | ||
340 | /* no need to ping if we got a response recently */ | 340 | /* |
341 | if (time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) | 341 | * We cannot send an echo until the NEGOTIATE_PROTOCOL request is done. |
342 | * Also, no need to ping if we got a response recently | ||
343 | */ | ||
344 | if (server->tcpStatus != CifsGood || | ||
345 | time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) | ||
342 | goto requeue_echo; | 346 | goto requeue_echo; |
343 | 347 | ||
344 | rc = CIFSSMBEcho(server); | 348 | rc = CIFSSMBEcho(server); |
@@ -578,12 +582,12 @@ incomplete_rcv: | |||
578 | else if (reconnect == 1) | 582 | else if (reconnect == 1) |
579 | continue; | 583 | continue; |
580 | 584 | ||
581 | length += 4; /* account for rfc1002 hdr */ | 585 | total_read += 4; /* account for rfc1002 hdr */ |
582 | 586 | ||
583 | 587 | dump_smb(smb_buffer, total_read); | |
584 | dump_smb(smb_buffer, length); | 588 | if (checkSMB(smb_buffer, smb_buffer->Mid, total_read)) { |
585 | if (checkSMB(smb_buffer, smb_buffer->Mid, total_read+4)) { | 589 | cifs_dump_mem("Bad SMB: ", smb_buffer, |
586 | cifs_dump_mem("Bad SMB: ", smb_buffer, 48); | 590 | total_read < 48 ? total_read : 48); |
587 | continue; | 591 | continue; |
588 | } | 592 | } |
589 | 593 | ||
@@ -633,11 +637,11 @@ incomplete_rcv: | |||
633 | mid_entry->largeBuf = isLargeBuf; | 637 | mid_entry->largeBuf = isLargeBuf; |
634 | multi_t2_fnd: | 638 | multi_t2_fnd: |
635 | mid_entry->midState = MID_RESPONSE_RECEIVED; | 639 | mid_entry->midState = MID_RESPONSE_RECEIVED; |
636 | list_del_init(&mid_entry->qhead); | ||
637 | mid_entry->callback(mid_entry); | ||
638 | #ifdef CONFIG_CIFS_STATS2 | 640 | #ifdef CONFIG_CIFS_STATS2 |
639 | mid_entry->when_received = jiffies; | 641 | mid_entry->when_received = jiffies; |
640 | #endif | 642 | #endif |
643 | list_del_init(&mid_entry->qhead); | ||
644 | mid_entry->callback(mid_entry); | ||
641 | break; | 645 | break; |
642 | } | 646 | } |
643 | mid_entry = NULL; | 647 | mid_entry = NULL; |